Fix process search for socks UDP associate

This commit is contained in:
世界
2026-09-06 15:54:54 +08:00
parent 0265f31f84
commit 0d7fae13bc
4 changed files with 7 additions and 3 deletions
+2
View File
@@ -17,6 +17,7 @@ import (
"github.com/sagernet/sing/common"
"github.com/sagernet/sing/common/auth"
E "github.com/sagernet/sing/common/exceptions"
M "github.com/sagernet/sing/common/metadata"
N "github.com/sagernet/sing/common/network"
"github.com/sagernet/sing/protocol/http"
"github.com/sagernet/sing/protocol/socks"
@@ -148,6 +149,7 @@ func (h *Inbound) newUserConnection(ctx context.Context, conn net.Conn, metadata
func (h *Inbound) streamUserPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext, onClose N.CloseHandlerFunc) {
metadata.Inbound = h.Tag()
metadata.InboundType = h.Type()
metadata.OriginDestination = M.SocksaddrFromNet(conn.LocalAddr()).Unwrap()
user, loaded := auth.UserFromContext[string](ctx)
if !loaded {
if !metadata.Destination.IsValid() {
+2
View File
@@ -16,6 +16,7 @@ import (
"github.com/sagernet/sing/common/auth"
E "github.com/sagernet/sing/common/exceptions"
"github.com/sagernet/sing/common/logger"
M "github.com/sagernet/sing/common/metadata"
N "github.com/sagernet/sing/common/network"
"github.com/sagernet/sing/protocol/socks"
)
@@ -99,6 +100,7 @@ func (h *Inbound) newUserConnection(ctx context.Context, conn net.Conn, metadata
func (h *Inbound) streamUserPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext, onClose N.CloseHandlerFunc) {
metadata.Inbound = h.Tag()
metadata.InboundType = h.Type()
metadata.OriginDestination = M.SocksaddrFromNet(conn.LocalAddr()).Unwrap()
user, loaded := auth.UserFromContext[string](ctx)
if !loaded {
if !metadata.Destination.IsValid() {