1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-25 06:26:50 +00:00

Configure HandshakeTimeout in websocket.Dialer

To prevent agent from being hung in the middle of Websocket Session
Handshake, We'd better to set HandshakeTimeout

Related to https://github.com/rancher/rancher/issues/21117
This commit is contained in:
Yuki Nishiwaki
2019-06-26 00:55:50 +09:00
parent f5744043a6
commit 129bbd3ca3
3 changed files with 3 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ func connectToProxy(proxyURL string, headers http.Header, auth ConnectAuthorizer
logrus.WithField("url", proxyURL).Info("Connecting to proxy")
if dialer == nil {
dialer = &websocket.Dialer{}
dialer = &websocket.Dialer{HandshakeTimeout: 10 * time.Second}
}
ws, _, err := dialer.Dial(proxyURL, headers)
if err != nil {