diff --git a/internal/http/handlers/chat.go b/internal/http/handlers/chat.go index f36ab09..8fd2bbb 100644 --- a/internal/http/handlers/chat.go +++ b/internal/http/handlers/chat.go @@ -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 }