From 2c8ae4330335731d85e12c7b39c24f4c7d0df5a2 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Wed, 3 Apr 2024 23:58:58 +0100 Subject: [PATCH] split 3 times, log last part --- pkg/udpproxy/session.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/udpproxy/session.go b/pkg/udpproxy/session.go index 01ef60e..f537205 100644 --- a/pkg/udpproxy/session.go +++ b/pkg/udpproxy/session.go @@ -89,8 +89,8 @@ func (s *session) proxyTo(buf []byte) error { } if s.isRconRequestPacket(buf) { - parts := strings.Split(string(buf), " ") - log.Infof("From [%s] To [%s] Command: %s", s.caddr.IP, s.serverConn.RemoteAddr(), strings.Join(parts[2:], " ")) + parts := strings.SplitN(string(buf), " ", 3) + log.Infof("From [%s] To [%s] Command: %s", s.caddr.IP, s.serverConn.RemoteAddr(), parts[len(parts)-1]) } return nil