v0.0.17.2 Переработан websocket, добавлена обработка ping/pong
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
6b9cdeba55
commit
039c8447a7
@ -130,6 +130,12 @@ func (h *ChatHandler) readPump(ctx context.Context, conn *websocket.Conn, client
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Обработка ping/pong
|
||||||
|
if msg.Type == "ping" {
|
||||||
|
conn.WriteJSON(map[string]string{"type": "pong"})
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if msg.Type != "message" {
|
if msg.Type != "message" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user