fix: udp assoc req malformed in socks5_outbound

fix: #561
This commit is contained in:
Haruue Icymoon 2023-02-07 16:43:50 +08:00
parent a7c159eeb3
commit b4dfbaa3f2
No known key found for this signature in database
GPG key ID: F6083B28CBCBC148

View file

@ -127,7 +127,9 @@ func (c *SOCKS5Client) ListenUDP() (STPacketConn, error) {
_ = conn.Close()
return nil, err
}
r := socks5.NewRequest(socks5.CmdUDP, socks5.ATYPIPv4, nil, nil)
var zeroIPv4 [4]byte
var zeroPort [2]byte
r := socks5.NewRequest(socks5.CmdUDP, socks5.ATYPIPv4, zeroIPv4[:], zeroPort[:])
reply, err := c.request(conn, r)
if err != nil {
_ = conn.Close()