Browse Source

skip localhost if bound to all interfaces already 0.0.0.0 or 127.0.0.1

pull/2767/head
chrislu 3 years ago
parent
commit
f247cab5cd
  1. 2
      weed/util/net_timeout.go

2
weed/util/net_timeout.go

@ -109,7 +109,7 @@ func NewIpAndLocalListeners(host string, port int, timeout time.Duration) (ipLis
WriteTimeout: timeout,
}
if host != "localhost" && host != "" {
if host != "localhost" && host != "" && host != "0.0.0.0" && host != "127.0.0.1" {
listner, err = net.Listen("tcp", JoinHostPort("localhost", port))
if err != nil {
return

Loading…
Cancel
Save