mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-12-19 16:30:07 +08:00
fix: server mux conn not close
This commit is contained in:
parent
9a124a390f
commit
02d954bfa8
2
go.mod
2
go.mod
@ -25,7 +25,7 @@ require (
|
|||||||
github.com/metacubex/randv2 v0.2.0
|
github.com/metacubex/randv2 v0.2.0
|
||||||
github.com/metacubex/restls-client-go v0.1.7
|
github.com/metacubex/restls-client-go v0.1.7
|
||||||
github.com/metacubex/sing v0.5.6-0.20250903022707-c9bf6d825f4d
|
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-quic v0.0.0-20250718154553-1b193bec4cbb
|
||||||
github.com/metacubex/sing-shadowsocks v0.2.12
|
github.com/metacubex/sing-shadowsocks v0.2.12
|
||||||
github.com/metacubex/sing-shadowsocks2 v0.2.6
|
github.com/metacubex/sing-shadowsocks2 v0.2.6
|
||||||
|
|||||||
4
go.sum
4
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.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 h1:oprae0GgOxsKpEDa8+pF0WMPrUhpKDRJtBWPAxcy3yo=
|
||||||
github.com/metacubex/sing v0.5.6-0.20250903022707-c9bf6d825f4d/go.mod h1:ypf0mjwlZm0sKdQSY+yQvmsbWa0hNPtkeqyRMGgoN+w=
|
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 h1:oqCbUAJgTLsa71vfo8otW8xIhrDfbc/Y2rmtW34sQjg=
|
||||||
github.com/metacubex/sing-mux v0.3.3-0.20250813083925-d7c9aeaeeaac/go.mod h1:3rt1soewn0O6j89GCLmwAQFsq257u0jf2zQSPhTL3Bw=
|
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 h1:U/m3h8lp/j7i8zFgfvScLdZa1/Y8dd74oO7iZaQq80s=
|
||||||
github.com/metacubex/sing-quic v0.0.0-20250718154553-1b193bec4cbb/go.mod h1:B60FxaPHjR1SeQB0IiLrgwgvKsaoASfOWdiqhLjmMGA=
|
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=
|
github.com/metacubex/sing-shadowsocks v0.2.12 h1:Wqzo8bYXrK5aWqxu/TjlTnYZzAKtKsaFQBdr6IHFaBE=
|
||||||
|
|||||||
@ -12,11 +12,14 @@ import (
|
|||||||
func (h *ListenerHandler) HandleSocket(target socks5.Addr, conn net.Conn, _additions ...inbound.Addition) {
|
func (h *ListenerHandler) HandleSocket(target socks5.Addr, conn net.Conn, _additions ...inbound.Addition) {
|
||||||
conn, metadata := inbound.NewSocket(target, conn, h.Type, h.Additions...)
|
conn, metadata := inbound.NewSocket(target, conn, h.Type, h.Additions...)
|
||||||
if h.IsSpecialFqdn(metadata.Host) {
|
if h.IsSpecialFqdn(metadata.Host) {
|
||||||
_ = h.ParseSpecialFqdn(
|
err := h.ParseSpecialFqdn(
|
||||||
WithAdditions(context.Background(), _additions...),
|
WithAdditions(context.Background(), _additions...),
|
||||||
conn,
|
conn,
|
||||||
ConvertMetadata(metadata),
|
ConvertMetadata(metadata),
|
||||||
)
|
)
|
||||||
|
if err != nil {
|
||||||
|
_ = conn.Close()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
inbound.ApplyAdditions(metadata, _additions...)
|
inbound.ApplyAdditions(metadata, _additions...)
|
||||||
h.Tunnel.HandleTCPConn(conn, metadata)
|
h.Tunnel.HandleTCPConn(conn, metadata)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user