Skip to content

Commit

Permalink
setting handshake timeout for gorilla websocket package which should …
Browse files Browse the repository at this point in the history
…solve the issue of connections dropping
  • Loading branch information
zephinzer committed Jun 29, 2021
1 parent 3d8a2b8 commit 909a776
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/cloudshell/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var conf = config.Map{
Shorthand: "H",
},
"arguments": &config.StringSlice{
Default: []string{"-l"},
Default: []string{},
Usage: "comma-delimited list of arguments that should be passed to the terminal command",
Shorthand: "r",
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/xtermjs/handler_websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func GetHandler(opts HandlerOpts) func(http.ResponseWriter, *http.Request) {
messageType, reader, err := connection.NextReader()
if err != nil {
if !connectionClosed {
clog.Warn("failed to get next reader: %s", err)
clog.Warnf("failed to get next reader: %s", err)
}
return
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/xtermjs/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ func getConnectionUpgrader(
logger.Warnf("failed to find '%s' in the list of allowed hostnames ('%s')", requesterHostname)
return false
},
ReadBufferSize: maxBufferSizeBytes,
WriteBufferSize: maxBufferSizeBytes,
HandshakeTimeout: 0,
ReadBufferSize: maxBufferSizeBytes,
WriteBufferSize: maxBufferSizeBytes,
}
}

0 comments on commit 909a776

Please sign in to comment.