Exit goroutine when connection is not WebSocket

This commit is contained in:
Vojtěch Káně
2019-06-28 15:18:16 +02:00
parent 2a23cedc6d
commit 45fc4bf135
+1
View File
@@ -56,6 +56,7 @@ func main() {
con, err := upgrader.Upgrade(w, r, nil)
if err != nil {
log.Println(err)
return
}
var quit = make(chan bool)
con.SetCloseHandler(func(code int, text string) error {