From 02d954bfa85fedb85efd9edb55ecd824179e03a6 Mon Sep 17 00:00:00 2001 From: wwqgtxx Date: Fri, 5 Sep 2025 13:40:51 +0800 Subject: [PATCH] fix: server mux conn not close --- go.mod | 2 +- go.sum | 4 ++-- listener/sing/util.go | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index faa4acbd..d413c488 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/metacubex/randv2 v0.2.0 github.com/metacubex/restls-client-go v0.1.7 github.com/metacubex/sing v0.5.6-0.20250903022707-c9bf6d825f4d - github.com/metacubex/sing-mux v0.3.3-0.20250813083925-d7c9aeaeeaac + github.com/metacubex/sing-mux v0.3.3 github.com/metacubex/sing-quic v0.0.0-20250718154553-1b193bec4cbb github.com/metacubex/sing-shadowsocks v0.2.12 github.com/metacubex/sing-shadowsocks2 v0.2.6 diff --git a/go.sum b/go.sum index 369c2354..f9547b1c 100644 --- a/go.sum +++ b/go.sum @@ -119,8 +119,8 @@ github.com/metacubex/restls-client-go v0.1.7/go.mod h1:BN/U52vPw7j8VTSh2vleD/Mnm github.com/metacubex/sing v0.5.2/go.mod h1:ypf0mjwlZm0sKdQSY+yQvmsbWa0hNPtkeqyRMGgoN+w= github.com/metacubex/sing v0.5.6-0.20250903022707-c9bf6d825f4d h1:oprae0GgOxsKpEDa8+pF0WMPrUhpKDRJtBWPAxcy3yo= github.com/metacubex/sing v0.5.6-0.20250903022707-c9bf6d825f4d/go.mod h1:ypf0mjwlZm0sKdQSY+yQvmsbWa0hNPtkeqyRMGgoN+w= -github.com/metacubex/sing-mux v0.3.3-0.20250813083925-d7c9aeaeeaac h1:wDH/Jh/yqWbzPktqJP+Y1cUG8hchcrzKzUxJiSpnaQs= -github.com/metacubex/sing-mux v0.3.3-0.20250813083925-d7c9aeaeeaac/go.mod h1:3rt1soewn0O6j89GCLmwAQFsq257u0jf2zQSPhTL3Bw= +github.com/metacubex/sing-mux v0.3.3 h1:oqCbUAJgTLsa71vfo8otW8xIhrDfbc/Y2rmtW34sQjg= +github.com/metacubex/sing-mux v0.3.3/go.mod h1:3rt1soewn0O6j89GCLmwAQFsq257u0jf2zQSPhTL3Bw= github.com/metacubex/sing-quic v0.0.0-20250718154553-1b193bec4cbb h1:U/m3h8lp/j7i8zFgfvScLdZa1/Y8dd74oO7iZaQq80s= github.com/metacubex/sing-quic v0.0.0-20250718154553-1b193bec4cbb/go.mod h1:B60FxaPHjR1SeQB0IiLrgwgvKsaoASfOWdiqhLjmMGA= github.com/metacubex/sing-shadowsocks v0.2.12 h1:Wqzo8bYXrK5aWqxu/TjlTnYZzAKtKsaFQBdr6IHFaBE= diff --git a/listener/sing/util.go b/listener/sing/util.go index 30630162..20d3e970 100644 --- a/listener/sing/util.go +++ b/listener/sing/util.go @@ -12,11 +12,14 @@ import ( func (h *ListenerHandler) HandleSocket(target socks5.Addr, conn net.Conn, _additions ...inbound.Addition) { conn, metadata := inbound.NewSocket(target, conn, h.Type, h.Additions...) if h.IsSpecialFqdn(metadata.Host) { - _ = h.ParseSpecialFqdn( + err := h.ParseSpecialFqdn( WithAdditions(context.Background(), _additions...), conn, ConvertMetadata(metadata), ) + if err != nil { + _ = conn.Close() + } } else { inbound.ApplyAdditions(metadata, _additions...) h.Tunnel.HandleTCPConn(conn, metadata)