Merge pull request #1411 from fatedier/new

proxy protocol: fix detect method for IPV4 and IPV6, fix #1410
This commit is contained in:
fatedier 2019-08-26 15:30:26 +08:00 committed by GitHub
commit 234d634bfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

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