Fix readHeaderTimeout in proxyproto
This commit is contained in:
parent
5be13802dc
commit
56e2110dc5
1 changed files with 6 additions and 1 deletions
|
@ -418,7 +418,12 @@ func (ln tcpKeepAliveListener) Accept() (net.Conn, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func buildProxyProtocolListener(ctx context.Context, entryPoint *static.EntryPoint, listener net.Listener) (net.Listener, error) {
|
func buildProxyProtocolListener(ctx context.Context, entryPoint *static.EntryPoint, listener net.Listener) (net.Listener, error) {
|
||||||
proxyListener := &proxyproto.Listener{Listener: listener}
|
timeout := entryPoint.Transport.RespondingTimeouts.ReadTimeout
|
||||||
|
// proxyproto use 200ms if ReadHeaderTimeout is set to 0 and not no timeout
|
||||||
|
if timeout == 0 {
|
||||||
|
timeout = -1
|
||||||
|
}
|
||||||
|
proxyListener := &proxyproto.Listener{Listener: listener, ReadHeaderTimeout: time.Duration(timeout)}
|
||||||
|
|
||||||
if entryPoint.ProxyProtocol.Insecure {
|
if entryPoint.ProxyProtocol.Insecure {
|
||||||
log.FromContext(ctx).Infof("Enabling ProxyProtocol without trusted IPs: Insecure")
|
log.FromContext(ctx).Infof("Enabling ProxyProtocol without trusted IPs: Insecure")
|
||||||
|
|
Loading…
Reference in a new issue