mirror of
https://github.com/jech/galene.git
synced 2024-12-22 23:35:46 +01:00
Add websocket handshake timeout.
This commit is contained in:
parent
7f4306ab3b
commit
5735322627
1 changed files with 4 additions and 2 deletions
|
@ -430,10 +430,12 @@ func statsHandler(w http.ResponseWriter, r *http.Request, dataDir string) {
|
|||
fmt.Fprintf(w, "</body></html>\n")
|
||||
}
|
||||
|
||||
var upgrader websocket.Upgrader
|
||||
var wsUpgrader = websocket.Upgrader {
|
||||
HandshakeTimeout: 30 * time.Second,
|
||||
}
|
||||
|
||||
func wsHandler(w http.ResponseWriter, r *http.Request) {
|
||||
conn, err := upgrader.Upgrade(w, r, nil)
|
||||
conn, err := wsUpgrader.Upgrade(w, r, nil)
|
||||
if err != nil {
|
||||
log.Printf("Websocket upgrade: %v", err)
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue