v0.0.17.2 Переработан websocket, добавлена обработка ping/pong
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
madipo2611 2025-08-11 13:46:39 +03:00
parent 6b9cdeba55
commit 039c8447a7

View File

@ -130,6 +130,12 @@ func (h *ChatHandler) readPump(ctx context.Context, conn *websocket.Conn, client
return
}
// Обработка ping/pong
if msg.Type == "ping" {
conn.WriteJSON(map[string]string{"type": "pong"})
continue
}
if msg.Type != "message" {
continue
}