New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow listen.host
to contain names
#825
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
@@ -107,7 +107,7 @@ lighthouse: | |||
# Port Nebula will be listening on. The default here is 4242. For a lighthouse node, the port should be defined, | |||
# however using port 0 will dynamically assign a port and is recommended for roaming nodes. | |||
listen: | |||
# To listen on both any ipv4 and ipv6 use "[::]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohh I guess this is the zero syntax w/o a port number, but the [
and ]
are optional?
listenHost = &net.IPAddr{IP: net.IPv6zero} | ||
|
||
} else { | ||
listenHost, err = net.ResolveIPAddr("ip", rawListenHost) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://pkg.go.dev/net#ResolveIPAddr
The address parameter can use a host name, but this is not recommended, because it will return at most one of the host name's IP addresses.
I guess that doesn't matter?
lc := NewListenConfig(multi) | ||
pc, err := lc.ListenPacket(context.TODO(), "udp", fmt.Sprintf("%s:%d", ip, port)) | ||
pc, err := lc.ListenPacket(context.TODO(), "udp", net.JoinHostPort(ip.String(), fmt.Sprintf("%v", port))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commenting these function docs for my own understanding, sorry if this is too much:
any docs on this feature to add to https://nebula.defined.net? |
On some networks (like fly.io, DO) it is desirable to listen on specific address and the easiest way to discover that address is by using a known name.
Closes #817