fix: proxyDialer has a non-nil interface containing nil pointer judgment
This commit is contained in:
parent
836615aac9
commit
42721f3b75
1 changed files with 4 additions and 2 deletions
|
@ -42,8 +42,10 @@ func (p proxyDialer) DialContext(ctx context.Context, network, address string) (
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
var rAddr net.Addr = currentMeta.UDPAddr()
|
var rAddr net.Addr
|
||||||
if rAddr == nil { // the domain name was not resolved, will appear in not stream-oriented udp like Shadowsocks/Tuic
|
if udpAddr := currentMeta.UDPAddr(); udpAddr != nil {
|
||||||
|
rAddr = udpAddr
|
||||||
|
} else { // the domain name was not resolved, will appear in not stream-oriented udp like Shadowsocks/Tuic
|
||||||
rAddr = N.NewCustomAddr("udp", currentMeta.RemoteAddress(), nil)
|
rAddr = N.NewCustomAddr("udp", currentMeta.RemoteAddress(), nil)
|
||||||
}
|
}
|
||||||
return N.NewBindPacketConn(pc, rAddr), nil
|
return N.NewBindPacketConn(pc, rAddr), nil
|
||||||
|
|
Loading…
Reference in a new issue