Skip to content

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

Open
edvakf wants to merge 1 commit into
typester:masterfrom
edvakf:websocket_close
Open

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

Conversation

@edvakf

@edvakf edvakf commented Nov 27, 2014

Copy link
Copy Markdown

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
Copy Markdown
Owner

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

@edvakf

edvakf commented Mar 1, 2015

Copy link
Copy Markdown
Author

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