mirror of
https://github.com/nadoo/glider.git
synced 2025-04-21 19:52:07 +08:00
fix: splithostport
This commit is contained in:
parent
426291030a
commit
d574f2c891
@ -91,14 +91,15 @@ func (s *Socks5) DialUDP(network, addr string) (pc net.PacketConn, writeTo net.A
|
|||||||
// if returned bind ip is unspecified
|
// if returned bind ip is unspecified
|
||||||
if ip := net.ParseIP(h); ip != nil && ip.IsUnspecified() {
|
if ip := net.ParseIP(h); ip != nil && ip.IsUnspecified() {
|
||||||
// indicate using conventional addr
|
// indicate using conventional addr
|
||||||
uAddress = net.JoinHostPort(s.addr, p)
|
h, _, _ = net.SplitHostPort(s.addr)
|
||||||
|
uAddress = net.JoinHostPort(h, p)
|
||||||
} else {
|
} else {
|
||||||
uAddress = uAddr.String()
|
uAddress = uAddr.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
pc, nextHop, err := s.dialer.DialUDP(network, uAddress)
|
pc, nextHop, err := s.dialer.DialUDP(network, uAddress)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.F("[socks5] dialudp to %s error: %s", uAddr.String(), err)
|
log.F("[socks5] dialudp to %s error: %s", uAddress, err)
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user