4
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2025-06-17 02:26:07 +00:00

Reusable peer lookup/dial logic

This commit is contained in:
Neil Alexander
2024-11-16 22:59:03 +00:00
parent 75d2080e53
commit 42873be09b
12 changed files with 193 additions and 124 deletions

View File

@ -191,9 +191,16 @@ func main() {
// Set up the Yggdrasil node itself.
{
iprange := net.IPNet{
IP: net.ParseIP("200::"),
Mask: net.CIDRMask(7, 128),
}
options := []core.SetupOption{
core.NodeInfo(cfg.NodeInfo),
core.NodeInfoPrivacy(cfg.NodeInfoPrivacy),
core.PeerFilter(func(ip net.IP) bool {
return !iprange.Contains(ip)
}),
}
for _, addr := range cfg.Listen {
options = append(options, core.ListenAddress(addr))