clean imports

This commit is contained in:
Darien Raymond
2017-01-14 00:27:45 +01:00
parent b40a139310
commit 8b00d6fc30
26 changed files with 96 additions and 100 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
package socks
import (
v2net "v2ray.com/core/common/net"
"v2ray.com/core/common/net"
"v2ray.com/core/common/protocol"
)
@@ -27,9 +27,9 @@ func (v *ServerConfig) HasAccount(username, password string) bool {
return storedPassed == password
}
func (v *ServerConfig) GetNetAddress() v2net.Address {
func (v *ServerConfig) GetNetAddress() net.Address {
if v.Address == nil {
return v2net.LocalHostIP
return net.LocalHostIP
}
return v.Address.AsAddress()
}
+3 -3
View File
@@ -3,7 +3,7 @@ package socks
import (
"v2ray.com/core/common/buf"
"v2ray.com/core/common/log"
v2net "v2ray.com/core/common/net"
"v2ray.com/core/common/net"
"v2ray.com/core/proxy"
"v2ray.com/core/transport/internet/udp"
)
@@ -16,7 +16,7 @@ func (v *Server) listenUDP() error {
return err
}
v.udpMutex.Lock()
v.udpAddress = v2net.UDPDestination(v.config.GetNetAddress(), v.meta.Port)
v.udpAddress = net.UDPDestination(v.config.GetNetAddress(), v.meta.Port)
v.udpHub = udpHub
v.udpMutex.Unlock()
return nil
@@ -43,7 +43,7 @@ func (v *Server) handleUDPPayload(payload *buf.Buffer, session *proxy.SessionInf
dataBuf := buf.NewSmall()
dataBuf.Append(data)
v.udpServer.Dispatch(&proxy.SessionInfo{Source: source, Destination: request.Destination(), Inbound: v.meta}, dataBuf, func(destination v2net.Destination, payload *buf.Buffer) {
v.udpServer.Dispatch(&proxy.SessionInfo{Source: source, Destination: request.Destination(), Inbound: v.meta}, dataBuf, func(destination net.Destination, payload *buf.Buffer) {
defer payload.Release()
log.Info("Socks: Writing back UDP response with ", payload.Len(), " bytes to ", destination)