Archived
2
0

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 {
id string
ws WebSocketHandler
ws *WebSocketHandler
connection *websocket.Conn
mu sync.Mutex
}

View File

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