Skip to content

Commit

Permalink
Merge pull request #291 from ukinau/Configure-WebSocket-Handshake
Browse files Browse the repository at this point in the history
Configure HandshakeTimeout in websocket.Dialer
  • Loading branch information
ibuildthecloud authored Jul 4, 2019
2 parents 2da1bd2 + 129bbd3 commit 043a1c9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clientbase/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func NewAPIClient(opts *ClientOpts) (APIBaseClient, error) {
result.Ops = &APIOperations{
Opts: opts,
Client: client,
Dialer: &websocket.Dialer{},
Dialer: &websocket.Dialer{HandshakeTimeout: 10 * time.Second},
Types: result.Types,
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/remotedialer/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions pkg/remotedialer/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func (p *peer) start(ctx context.Context, s *Server) {
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
HandshakeTimeout: 10 * time.Second,
}

outer:
Expand Down

0 comments on commit 043a1c9

Please sign in to comment.