add WebSocketHandler to WebSocket struct
This commit is contained in:
parent
bc38e036da
commit
9310bb5572
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user