From 28b1b7c819dce23a64307dbdf9db0c9872dd9291 Mon Sep 17 00:00:00 2001 From: set Date: Wed, 11 Mar 2026 17:21:26 +0200 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=BA=D1=80=D1=8B=D1=82=D0=B8?= =?UTF-8?q?=D0=B5=20=D1=81=D0=BE=D0=BA=D0=B5=D1=82=D0=B0=20=D0=BF=D0=BE?= =?UTF-8?q?=D1=81=D0=BB=D0=B5=20=D0=BD=D0=B5=D1=83=D1=81=D0=BF=D0=B5=D1=88?= =?UTF-8?q?=D0=BD=D0=BE=D0=B3=D0=BE=20handshake?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- socket/socket.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/socket/socket.go b/socket/socket.go index 45911a5..b9196bc 100644 --- a/socket/socket.go +++ b/socket/socket.go @@ -82,12 +82,14 @@ func processData(data <-chan []byte, connection *Connection) { } connection.Socket.WriteMessage(websocket.BinaryMessage, []byte{0xFF}) logger.LogWarnMessage("failed handshake from " + connection.Socket.RemoteAddr().String() + " because of invalid secret key") + connection.Socket.Close() return } // Так как следующие пакеты требуют обязательного завершения рукопожатия, нужно проверять, что сокет уже прошел рукопожатие if _, exists := GetSocket(connection.Identificator); !exists { logger.LogWarnMessage("received data from " + connection.Socket.RemoteAddr().String() + " but it has not completed handshake") + connection.Socket.Close() return }