From 039c8447a74dc50a1b9b425305b34dfee4381c84 Mon Sep 17 00:00:00 2001 From: madipo2611 Date: Mon, 11 Aug 2025 13:46:39 +0300 Subject: [PATCH] =?UTF-8?q?v0.0.17.2=20=D0=9F=D0=B5=D1=80=D0=B5=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=BD=20websocket,=20=D0=B4?= =?UTF-8?q?=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=BE=D0=B1?= =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA=D0=B0=20ping/pong?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/http/handlers/chat.go | 6 ++++++ 1 file changed, 6 insertions(+) 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 }