diff --git a/ws/server.go b/ws/server.go index e81dd70..9c36426 100644 --- a/ws/server.go +++ b/ws/server.go @@ -76,6 +76,12 @@ func (s *Server) Launch() error { upgrader, err := upgrader.Upgrade(sock) if err != nil { fmt.Printf(" - upgrade error: %s\n", err) + sock.Close() + continue + } + if upgrader.Response.GetStatusCode() != 101 { + fmt.Printf(" - upgrade bad request\n") + sock.Close() continue }