From fdc6902a9064db8a8dc132efcec7df992992670d Mon Sep 17 00:00:00 2001 From: fatedier Date: Mon, 26 Aug 2019 11:13:33 +0800 Subject: [PATCH] proxy protocol: fix detect method for IPV4 and IPV6 --- client/proxy/proxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/proxy/proxy.go b/client/proxy/proxy.go index 0c43740f..f5e1b603 100644 --- a/client/proxy/proxy.go +++ b/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