reid %!s(int64=2) %!d(string=hai) anos
pai
achega
1fc8a5905d
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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))