Optional proxyproto header

This commit is contained in:
zakuwaki
2022-09-07 23:01:57 +08:00
committed by 世界
parent 87bc292296
commit 46a8f24400
3 changed files with 18 additions and 13 deletions

View File

@@ -29,7 +29,7 @@ func (a *myInboundAdapter) ListenTCP() (net.Listener, error) {
}
if a.listenOptions.ProxyProtocol {
a.logger.Debug("proxy protocol enabled")
tcpListener = &proxyproto.Listener{Listener: tcpListener}
tcpListener = &proxyproto.Listener{Listener: tcpListener, AcceptNoHeader: a.listenOptions.ProxyProtocolAcceptNoHeader}
}
a.tcpListener = tcpListener
return tcpListener, err