diff --git a/adapter/outbound/socks5.go b/adapter/outbound/socks5.go index 4f81621..9b11bac 100644 --- a/adapter/outbound/socks5.go +++ b/adapter/outbound/socks5.go @@ -7,6 +7,7 @@ import ( "fmt" "io" "net" + "net/netip" "strconv" "github.com/Dreamacro/clash/component/dialer" @@ -110,7 +111,8 @@ func (ss *Socks5) ListenPacketContext(ctx context.Context, metadata *C.Metadata, } } - bindAddr, err := socks5.ClientHandshake(c, serializesSocksAddr(metadata), socks5.CmdUDPAssociate, user) + udpAssocateAddr := socks5.AddrFromStdAddrPort(netip.AddrPortFrom(netip.IPv4Unspecified(), 0)) + bindAddr, err := socks5.ClientHandshake(c, udpAssocateAddr, socks5.CmdUDPAssociate, user) if err != nil { err = fmt.Errorf("client hanshake error: %w", err) return