Fix: cannot listen socks5 port on wsl (#748)

This commit is contained in:
limgmk 2020-06-15 10:34:15 +08:00 committed by GitHub
parent 9f1d85ab6e
commit 99b34e8d8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import (
"net"
"github.com/Dreamacro/clash/common/sockopt"
"github.com/Dreamacro/clash/log"
D "github.com/miekg/dns"
)
@ -62,7 +63,7 @@ func ReCreateServer(addr string, resolver *Resolver) error {
err = sockopt.UDPReuseaddr(p)
if err != nil {
return err
log.Warnln("Failed to Reuse UDP Address: %s", err)
}
address = addr

View File

@ -8,6 +8,7 @@ import (
"github.com/Dreamacro/clash/common/sockopt"
"github.com/Dreamacro/clash/component/socks5"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/log"
"github.com/Dreamacro/clash/tunnel"
)
@ -25,7 +26,7 @@ func NewSocksUDPProxy(addr string) (*SockUDPListener, error) {
err = sockopt.UDPReuseaddr(l.(*net.UDPConn))
if err != nil {
return nil, err
log.Warnln("Failed to Reuse UDP Address: %s", err)
}
sl := &SockUDPListener{l, addr, false}