perlin-network / noise

A decentralized P2P networking stack written in Go.
https://godoc.org/github.com/perlin-network/noise
MIT License
1.78k stars 213 forks source link

Advertisment converting ipv4 into ipv6 #290

Open danthegoodman1 opened 3 years ago

danthegoodman1 commented 3 years ago

with the code noise.NewNode(noise.WithNodeBindHost(netIP), noise.WithNodeBindPort(uint16(*NodePort))), when a message is sent to something using the ipv4 address 192.168.0.4 it works fine. However when I go back through kademlia table: for _, node := range overlay.Table().Peers() { log.Println(node) log.Println(node.Host) } I get addresses like "address": "[c0a8:1c1::]:4444" and a host of c0a8:1c1::.

How do I prevent it from converting into an IPv6 address?

Edit: I'll also add that the node knows the IPv4 itself: log.Println("Node listening on:", TestNode.Addr()) -> Node listening on: 192.168.1.193:4444