diff --git a/server.go b/server.go index befe257..2b399d1 100644 --- a/server.go +++ b/server.go @@ -2,6 +2,7 @@ package mux import ( "context" + "github.com/sagernet/sing/common/debug" "net" "github.com/sagernet/sing/common/bufio" @@ -112,11 +113,14 @@ func (s *Service) newConnection(ctx context.Context, sessionConn net.Conn, strea } err = SetBrutalOptions(sessionConn, sendBPS) if err != nil { - err = WriteBrutalResponse(conn, 0, false, E.Cause(err, "enable TCP Brutal").Error()) - if err != nil { - return E.Cause(err, "write brutal response") + // ignore error in test + if !debug.Enabled { + err = WriteBrutalResponse(conn, 0, false, E.Cause(err, "enable TCP Brutal").Error()) + if err != nil { + return E.Cause(err, "write brutal response") + } + return nil } - return nil } err = WriteBrutalResponse(conn, s.brutal.ReceiveBPS, true, "") if err != nil {