mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
Merge pull request #1062 from nemothekid/fix/ws-connection-close
Proxy: Set MaxIdleConnsPerHost to -1 to prevent Idle Conns
This commit is contained in:
commit
15d25f1ca4
1 changed files with 2 additions and 2 deletions
|
@ -304,7 +304,7 @@ func newConnHijackerTransport(base http.RoundTripper) *connHijackerTransport {
|
||||||
KeepAlive: 30 * time.Second,
|
KeepAlive: 30 * time.Second,
|
||||||
}).Dial,
|
}).Dial,
|
||||||
TLSHandshakeTimeout: 10 * time.Second,
|
TLSHandshakeTimeout: 10 * time.Second,
|
||||||
DisableKeepAlives: true,
|
MaxIdleConnsPerHost: -1,
|
||||||
}
|
}
|
||||||
if base != nil {
|
if base != nil {
|
||||||
if baseTransport, ok := base.(*http.Transport); ok {
|
if baseTransport, ok := base.(*http.Transport); ok {
|
||||||
|
@ -313,7 +313,7 @@ func newConnHijackerTransport(base http.RoundTripper) *connHijackerTransport {
|
||||||
transport.TLSHandshakeTimeout = baseTransport.TLSHandshakeTimeout
|
transport.TLSHandshakeTimeout = baseTransport.TLSHandshakeTimeout
|
||||||
transport.Dial = baseTransport.Dial
|
transport.Dial = baseTransport.Dial
|
||||||
transport.DialTLS = baseTransport.DialTLS
|
transport.DialTLS = baseTransport.DialTLS
|
||||||
transport.DisableKeepAlives = true
|
transport.MaxIdleConnsPerHost = -1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hjTransport := &connHijackerTransport{transport, nil, bufferPool.Get().([]byte)[:0]}
|
hjTransport := &connHijackerTransport{transport, nil, bufferPool.Get().([]byte)[:0]}
|
||||||
|
|
Loading…
Reference in a new issue