feat: make sure SOCKS5 listen address has a specified IP (for UDP to work)

This commit is contained in:
Toby 2021-12-03 21:50:07 -08:00
parent fb189c5411
commit c811b8e558

View File

@ -52,6 +52,9 @@ func NewServer(hyClient *core.Client, transport transport.Transport, addr string
if err != nil {
return nil, err
}
if tAddr.IP == nil || tAddr.IP.IsUnspecified() {
return nil, errors.New("listen address must have a specified IP")
}
m := socks5.MethodNone
if authFunc != nil {
m = socks5.MethodUsernamePassword