Explorar o código

Merge pull request #1411 from fatedier/new

proxy protocol: fix detect method for IPV4 and IPV6, fix #1410
fatedier %!s(int64=5) %!d(string=hai) anos
pai
achega
234d634bfe
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      client/proxy/proxy.go

+ 1 - 1
client/proxy/proxy.go

@@ -521,7 +521,7 @@ func HandleTcpWorkConnection(localInfo *config.LocalSvrConf, proxyPlugin plugin.
 				DestinationPort:    m.DstPort,
 			}
 
-			if h.SourceAddress.To16() == nil {
+			if strings.Contains(m.SrcAddr, ".") {
 				h.TransportProtocol = pp.TCPv4
 			} else {
 				h.TransportProtocol = pp.TCPv6