add WebSocketHandler to WebSocket struct

This commit is contained in:
Craig 2020-02-14 03:52:14 +00:00
parent bc38e036da
commit 9310bb5572
2 changed files with 2 additions and 1 deletions

View File

@ -10,7 +10,7 @@ import (
type WebSocket struct { type WebSocket struct {
id string id string
ws WebSocketHandler ws *WebSocketHandler
connection *websocket.Conn connection *websocket.Conn
mu sync.Mutex mu sync.Mutex
} }

View File

@ -142,6 +142,7 @@ func (ws *WebSocketHandler) Upgrade(w http.ResponseWriter, r *http.Request) erro
socket := &WebSocket{ socket := &WebSocket{
id: id, id: id,
ws: ws,
connection: connection, connection: connection,
} }