gate
gate copied to clipboard
Fix bug where WebSocket's close wasn't sent to client
At the moment, gate keeps holding the connection when the server closes a WebSocket connection through gate. Therefore, onclose of JavaScript's WebSocket object never gets called.
To be honest, I'm not too sure why this patch solves the problem... but I got it from studying another WebSocket proxy.
https://github.com/joinmytalk/drunken-hipster/blob/master/main.go#L49-L65
Can you provide some html+javascript samples that reproduce this issue?
An echo server example.
https://github.com/edvakf/go-websocket-sample
go run main.go
Type "bye" and hit enter to make the server close the connection.