Skip to content

Commit bb1d80e

Browse 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

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

server.go

Lines 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy