libasyncd
libasyncd copied to clipboard
Listening on multiple IP addresses
I need the server to listen on both IPv6 and IPv4 addresses. How do I do that?
I could think of few options:
- to have a special host name
"*"
that would imply listening on all available addresses (may be a bit tricky to implement as one would need to check what address types are actually available). - to extend
"server.addr"
or add new"server.listen"
option that supports a comma separated list of addresses as follows"0.0.0.0:443,[::]:8888,localhost"
(if port is not specified then use"server.port"
option as common default). Better, but some parsing would be required. - to have
ad_server_add_listen_addr(server, addr, port)
method to add sockets.
My favorite is 3 but it will break backward compatibility. What do you think?
+1 on the option 2 as it doesn't ntroduce new api to remember.