libasyncd icon indicating copy to clipboard operation
libasyncd copied to clipboard

Listening on multiple IP addresses

Open dtoubelis opened this issue 9 years ago • 2 comments

I need the server to listen on both IPv6 and IPv4 addresses. How do I do that?

dtoubelis avatar May 13 '15 19:05 dtoubelis

I could think of few options:

  1. 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).
  2. 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.
  3. 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?

dtoubelis avatar May 15 '15 15:05 dtoubelis

+1 on the option 2 as it doesn't ntroduce new api to remember.

wolkykim avatar Jun 13 '15 09:06 wolkykim