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 }