Skip to content

Commit

Permalink
Fix: socks5 udp associate
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamacro committed Aug 10, 2023
1 parent 033dbf7 commit ac3fd60
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion adapter/outbound/socks5.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"io"
"net"
"net/netip"
"strconv"

"github.com/Dreamacro/clash/component/dialer"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ac3fd60

Please sign in to comment.