mochi/mochiweb

inet expects either inet or inet6 but mochiweb_socket_server passes both

Opened this issue · 1 comments

cacay commented

mochiweb_socket_server passes both inet and inet6, which makes gen_tcp and/or ssl default to the first (IPv4 in this case). From what I can tell, there is no portable way to support both IPv4 and IPv6 on the same port (see the documentation for the ipv6_v6only option for inet). I think the closes best-effort behavior would be passing in inet6, {ipv6_v6only, true}. A better option is to force the user to pick one or the other.

The best way to get this promptly fixed would be to contribute a PR with tests, which would demonstrate that it works as expected and does not regress in the future.