mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-07 00:33:19 +00:00
format code
This commit is contained in:
1 parent
7a24dc3e09
commit
78daf8a879
7 files changed
+26
-26
No files matched your search
@@ -60,12 +60,12 @@ func (config VNextConfig) ToVNextServer(network string) VNextServer {
|
||||
panic(log.Error("Unable to parse VNext IP: %s", config.Address))
|
||||
}
|
||||
address := v2net.IPAddress(ip, config.Port)
|
||||
var dest v2net.Destination
|
||||
if network == "tcp" {
|
||||
dest = v2net.NewTCPDestination(address)
|
||||
} else {
|
||||
dest = v2net.NewUDPDestination(address)
|
||||
}
|
||||
var dest v2net.Destination
|
||||
if network == "tcp" {
|
||||
dest = v2net.NewTCPDestination(address)
|
||||
} else {
|
||||
dest = v2net.NewUDPDestination(address)
|
||||
}
|
||||
return VNextServer{
|
||||
Destination: dest,
|
||||
Users: users,
|
||||
|
||||
@@ -93,6 +93,6 @@ func (handler *VMessInboundHandler) handlePacket(conn *net.UDPConn, request *pro
|
||||
|
||||
if hasData {
|
||||
conn.WriteToUDP(buffer.Bytes(), clientAddr)
|
||||
log.Info("VMessIn sending %d bytes to %s", len(buffer.Bytes()), clientAddr.String())
|
||||
log.Info("VMessIn sending %d bytes to %s", len(buffer.Bytes()), clientAddr.String())
|
||||
}
|
||||
}
|
||||
@@ -181,7 +181,7 @@ func handleResponse(conn net.Conn, request *protocol.VMessRequest, output chan<-
|
||||
log.Warning("VMessOut: unexepcted response header. The connection is probably hijacked.")
|
||||
return
|
||||
}
|
||||
log.Info("VMessOut received %d bytes from %s", len(buffer) - 4, conn.RemoteAddr().String())
|
||||
log.Info("VMessOut received %d bytes from %s", len(buffer)-4, conn.RemoteAddr().String())
|
||||
|
||||
output <- buffer[4:]
|
||||
|
||||
|
||||
Reference in new issue
Block a user