reid 2 anos atrás
pai
commit
1fc8a5905d
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      ws/ws.go

+ 3 - 0
ws/ws.go

@@ -53,6 +53,9 @@ func WsHandler(w http.ResponseWriter, r *http.Request) {
 	// manage broadcasts and clients thru the broadcast package
 	// broadcast.RegisterClient(conn)
 	// defer broadcast.UnregisterClient(conn)
+	if !auth.WsAuthCheck(conn) {
+		unauthHandler(conn, r)
+	}
 	// keepalive for ws
 	conn.SetPongHandler(func(string) error {
 		conn.SetReadDeadline(time.Now().Add(60 * time.Second))