From c6703783c4a796045c0c385a8705c2756a1d8710 Mon Sep 17 00:00:00 2001 From: samosvalishe Date: Tue, 18 Aug 2026 15:02:33 +0300 Subject: [PATCH] =?UTF-8?q?feat(server):=20=D0=B0=D0=B4=D1=80=D0=B5=D1=81?= =?UTF-8?q?=20=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=D0=B0=20=D0=B2=20=D0=BB?= =?UTF-8?q?=D0=BE=D0=B3=D0=B0=D1=85=20=D1=81=D0=B5=D1=81=D1=81=D0=B8=D0=B8?= =?UTF-8?q?=20=D0=B8=20handshake?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/server/main.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/server/main.go b/cmd/server/main.go index 8db6cbc..9d06b51 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -169,7 +169,9 @@ func handleAccepted(ctx context.Context, logger logx.Logger, db *clientsdb.DB, c } logger.Debugf("Start handshake") if err := dtlsConn.HandshakeContext(ctx1); err != nil { - logger.Warnf("Handshake failed: %v", err) + // Адрес обязателен: пачка таймаутов с новых адресов - признак того, что клиент + // сменил relayed-адрес, а его сессия сюда не смигрировала. + logger.Warnf("Handshake failed from %s: %v", conn.RemoteAddr(), err) return } logger.Debugf("Handshake done") @@ -190,9 +192,9 @@ func handleAccepted(ctx context.Context, logger logx.Logger, db *clientsdb.DB, c logger.Debugf("Client ID received (no allowlist): %s", clientID) } + logger.Infof("Session up: client=%s from=%s", clientID, conn.RemoteAddr()) udpserver.Handle(ctx, logger, conn, cfg.Proxy.Connect) - - logger.Debugf("Connection closed: %s", conn.RemoteAddr()) + logger.Infof("Session down: client=%s from=%s", clientID, conn.RemoteAddr()) } func handleClientsCommand(args []string) {