From 99b34e8d8b8f53caf90fe66a595aedf451ca6f67 Mon Sep 17 00:00:00 2001 From: limgmk <45861815+Limgmk@users.noreply.github.com> Date: Mon, 15 Jun 2020 10:34:15 +0800 Subject: [PATCH] Fix: cannot listen socks5 port on wsl (#748) --- dns/server.go | 3 ++- proxy/socks/udp.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dns/server.go b/dns/server.go index c2bd08c8..7af83f96 100644 --- a/dns/server.go +++ b/dns/server.go @@ -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 diff --git a/proxy/socks/udp.go b/proxy/socks/udp.go index 90ccad1b..38bc1131 100644 --- a/proxy/socks/udp.go +++ b/proxy/socks/udp.go @@ -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}