From 33e63afb0fded146d61a376b9fd84d300e7ad573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Mon, 24 Aug 2026 09:16:41 +0800 Subject: [PATCH] snell: Fix UDP requests to domain destinations --- go.mod | 2 +- go.sum | 4 ++-- protocol/snell/inbound.go | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 258fb961..d419519e 100644 --- a/go.mod +++ b/go.mod @@ -54,7 +54,7 @@ require ( github.com/sagernet/sing-shadowsocks v0.2.8 github.com/sagernet/sing-shadowsocks2 v0.2.1 github.com/sagernet/sing-shadowtls v0.2.1 - github.com/sagernet/sing-snell v0.0.0-20260727093646-7cb813e07b73 + github.com/sagernet/sing-snell v0.0.0-20260824011554-f8ab8029469a github.com/sagernet/sing-tun v0.9.0-beta.4 github.com/sagernet/sing-usbip v0.0.0-20260817040617-28bd42667eca github.com/sagernet/sing-vmess v0.2.8-0.20250909125414-3aed155119a1 diff --git a/go.sum b/go.sum index 0f928003..ba1ce45c 100644 --- a/go.sum +++ b/go.sum @@ -336,8 +336,8 @@ github.com/sagernet/sing-shadowsocks2 v0.2.1 h1:dWV9OXCeFPuYGHb6IRqlSptVnSzOelnq github.com/sagernet/sing-shadowsocks2 v0.2.1/go.mod h1:RnXS0lExcDAovvDeniJ4IKa2IuChrdipolPYWBv9hWQ= github.com/sagernet/sing-shadowtls v0.2.1 h1:ZiHZdnEnP+YS73NMsxiZmIFCwNd0M4k7PkGCKNXhbaM= github.com/sagernet/sing-shadowtls v0.2.1/go.mod h1:sWqKnGlMipCHaGsw1sTTlimyUpgzP4WP3pjhCsYt9oA= -github.com/sagernet/sing-snell v0.0.0-20260727093646-7cb813e07b73 h1:Iyhoka9XutVbIhkhjn6s2Ez2AEuBG5i4KbkQKqRMsug= -github.com/sagernet/sing-snell v0.0.0-20260727093646-7cb813e07b73/go.mod h1:et8Lws4f5QbOrY65DmjevHGup3mijJkhswkto6cwciM= +github.com/sagernet/sing-snell v0.0.0-20260824011554-f8ab8029469a h1:J0Nkymr+slpy0zNQje5X1tCV5+qMGSmALaIIkrGkKvQ= +github.com/sagernet/sing-snell v0.0.0-20260824011554-f8ab8029469a/go.mod h1:et8Lws4f5QbOrY65DmjevHGup3mijJkhswkto6cwciM= github.com/sagernet/sing-tun v0.9.0-beta.4 h1:gIIZU4HevhtTQubZiOdMD0/RnECD6csl2kG6666KYmQ= github.com/sagernet/sing-tun v0.9.0-beta.4/go.mod h1:3EgPst7agntRO7D6GOsiZ1l9FoqdLeuWmKT5TnWkmf0= github.com/sagernet/sing-usbip v0.0.0-20260817040617-28bd42667eca h1:5wA+IE0Fq1CGVLOgSpm0gKKZ03HzugcJ2JyhmDqeX6A= diff --git a/protocol/snell/inbound.go b/protocol/snell/inbound.go index 45b81f43..4ef07df1 100644 --- a/protocol/snell/inbound.go +++ b/protocol/snell/inbound.go @@ -189,6 +189,8 @@ func (h *Inbound) newConnection(ctx context.Context, conn net.Conn, metadata ada func (h *Inbound) newPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext, onClose N.CloseHandlerFunc) { metadata.Inbound = h.Tag() metadata.InboundType = h.Type() + // The snell client in Surge rejects UDP responses with domain addresses. + metadata.UDPDisableDomainUnmapping = true if len(h.users) > 0 { userIndex, loaded := auth.UserFromContext[int](ctx) if !loaded {