Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bb1d80e

Browse filesBrowse files
committed
Merge pull request revel#860 from revel/bug/websocket-connection-deadline
Adds debug code to reproduce websocket connection timeout issue
2 parents 6f65648 + 0680b8e commit bb1d80e
Copy full SHA for bb1d80e

File tree

1 file changed

+2
-0
lines changed
Filter options

1 file changed

+2
-0
lines changed

‎server.go

Copy file name to clipboardExpand all lines: server.go
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ func handle(w http.ResponseWriter, r *http.Request) {
2525
upgrade := r.Header.Get("Upgrade")
2626
if upgrade == "websocket" || upgrade == "Websocket" {
2727
websocket.Handler(func(ws *websocket.Conn) {
28+
//Override default Read/Write timeout with sane value for a web socket request
29+
ws.SetDeadline(time.Now().Add(time.Hour * 24))
2830
r.Method = "WS"
2931
handleInternal(w, r, ws)
3032
}).ServeHTTP(w, r)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.