Skip to content
Snippets Groups Projects
Commit 16c7e44d authored by capossele's avatar capossele
Browse files

:bug: listens on 0.0.0.0 if not on loopback

parent 97172be5
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,13 @@ func Listen(local *peer.Local, log *zap.SugaredLogger) (*TCP, error) {
if gossipAddr == nil {
return nil, ErrNoGossip
}
tcpAddr, err := net.ResolveTCPAddr(gossipAddr.Network(), gossipAddr.String())
host, port, _ := net.SplitHostPort(gossipAddr.String())
if host != "127.0.0.1" {
host = "0.0.0.0"
}
tcpAddr, err := net.ResolveTCPAddr(gossipAddr.Network(), host+":"+port)
if err != nil {
return nil, err
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment