Skip to content

Comments

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

Open
edvakf wants to merge 1 commit intotypester:masterfrom
edvakf:websocket_close
Open

Fix bug where WebSocket's close wasn't sent to client#14
edvakf wants to merge 1 commit intotypester:masterfrom
edvakf:websocket_close

Conversation

@edvakf
Copy link

@edvakf edvakf commented Nov 27, 2014

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

@typester
Copy link
Owner

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

@edvakf
Copy link
Author

edvakf commented Mar 1, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants