reid 2 年 前
コミット
59a1e2b6fe
1 ファイル変更11 行追加10 行削除
  1. 11 10
      ws/ws.go

+ 11 - 10
ws/ws.go

@@ -51,8 +51,8 @@ func WsHandler(w http.ResponseWriter, r *http.Request) {
 		return
 	}
 	// manage broadcasts and clients thru the broadcast package
-	broadcast.RegisterClient(conn)
-	defer broadcast.UnregisterClient(conn)
+	// broadcast.RegisterClient(conn)
+	// defer broadcast.UnregisterClient(conn)
 	// keepalive for ws
 	conn.SetPongHandler(func(string) error {
 		conn.SetReadDeadline(time.Now().Add(60 * time.Second))
@@ -185,17 +185,18 @@ func loginHandler(conn *websocket.Conn, msg []byte, payload structs.WsPayload) e
 	return nil
 }
 
+
 // broadcast the unauth payload
 func unauthHandler(conn *websocket.Conn, r *http.Request) {
 	blob := structs.UnauthBroadcast{
-		Type:      "structure",
-		AuthLevel: "unauthorized",
-		Login: struct {
-			Remainder int `json:"remainder"`
-		}{
-			Remainder: 0,
-		},
-	}
+        Type:      "structure",
+        AuthLevel: "unauthorized",
+        Login: struct {
+            Remainder int `json:"remainder"`
+        }{
+            Remainder: 0,
+        },
+    }
 	resp, err := json.Marshal(blob)
 	if err != nil {
 		config.Logger.Error(fmt.Sprintf("Error unmarshalling message: %v", err))