gate icon indicating copy to clipboard operation
gate copied to clipboard

Fix bug where WebSocket's close wasn't sent to client

Open edvakf opened this issue 10 years ago • 2 comments

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

edvakf avatar Nov 27 '14 10:11 edvakf

Can you provide some html+javascript samples that reproduce this issue?

typester avatar Feb 28 '15 07:02 typester

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.

edvakf avatar Mar 01 '15 05:03 edvakf