The goroutine is stuck at124 done <- trueUse a buffered channel to avoid this issue:117 done := make(chan bool, 1)
Yeah, my error. The unbuffered channel code is also correct.
- Use github.com/gorillla/webscoket instead of github.com/garyburd/go-websocket.- The application should read the connection to handle PINGs sent by the browser and PONGs sent in response to the server's PINGs.- I cannot reproduce the problem with my test application. What operating system, browser and version of Go are you using?
Or have the ws closed in js and look at the network inspector in chrome?
Also just a side note, you don't check the error at the start, you should define err inside the go routine also because the closure hides from the compiler that you didn't use it