Nope, IO::Socket::IP is not just a drop in replacement...
> Looking at the code, I am wondering why you don't just use IO::Socket::INET6 instead of IO::Socket:IP. I know that the newer module is supposed to be a drop in replacement for
> IO::Socket::INET, but then so is IO::Socket::INET6, at least for the use that you are putting to it.
Nope, IO::Socket::IP is not just a drop in replacement, it supports multi-homed non-blocking connect for example, something IO::Socket::INET6 can't do because of its broken design.
So any suggestions as to why I can't listen on an ipv6 addess?
Is it possible to listen on the same port number on both the IPv4 address and the IPv6 address?
Is it possible for one Mojolicious process to listen on port 80 for both the IPv6 address as well as the IPv4 address?
Is it possible for one Mojolicious process to listen on port 80 for both the IPv6 address as well as the IPv4 address?Should we have IPv6 experts on this list, this might be worth investigating (and possibly patch), but i suppose portability and backwards compatibility (especially regarding security) could be problematic.
On Tue, Jan 14, 2014 at 9:02 PM, sri <kra...@googlemail.com> wrote:
Is it possible for one Mojolicious process to listen on port 80 for both the IPv6 address as well as the IPv4 address?Should we have IPv6 experts on this list, this might be worth investigating (and possibly patch), but i suppose portability and backwards compatibility (especially regarding security) could be problematic.Perhaps the issue is related to this. When listening to two different interfaces, only the first works. When using * both work. But * does not pick up on IPv6 addresses.$ env MOJO_LOG_LEVEL=debug MOJO_LISTEN=http://127.0.0.1:8080,http://192.168.0.108:8080 perl -Mojo -E 'a("/"=>sub{$_->app->log->debug("Remote Address: ".$_->tx->remote_address); $_->render(text=>$_->tx->remote_address."\n")})->start' daemon[Tue Jan 14 21:30:46 2014] [info] Listening at "http://127.0.0.1:8080".Server available at http://127.0.0.1:8080.[Tue Jan 14 21:30:46 2014] [info] Listening at "http://192.168.0.108:8080".Server available at http://192.168.0.108:8080.
$ curl http://127.0.0.1:8080127.0.0.1$ curl http://192.168.0.108:8080curl: (7) couldn't connect to host$ env MOJO_LOG_LEVEL=debug MOJO_LISTEN=http://192.168.0.108:8080,http://127.0.0.1:8080 perl -Mojo -E 'a("/"=>sub{$_->app->log->debug("Remote Address: ".$_->tx->remote_address); $_->render(text=>$_->tx->remote_address."\n")})->start' daemon[Tue Jan 14 21:34:26 2014] [info] Listening at "http://192.168.0.108:8080".Server available at http://192.168.0.108:8080.[Tue Jan 14 21:34:26 2014] [info] Listening at "http://127.0.0.1:8080".Server available at http://127.0.0.1:8080.
$ curl http://127.0.0.1:8080curl: (7) couldn't connect to host$ curl http://192.168.0.108:8080192.168.0.108$ env MOJO_LOG_LEVEL=debug MOJO_LISTEN=http://*:8080 perl -Mojo -E 'a("/"=>sub{$_->app->log->debug("Remote Address: ".$_->tx->remote_address); $_->render(text=>$_->tx->remote_address."\n")})->start' daemon
I don't know what this means, but between lines 63 and 64 of Mojo::IOLoop::Server, I did `undef $fd;'...
Am I missing something here? Unless you are perming these two addresses out of several more, what's wrong with: MOJO_LISTEN=http://[::]:80 ? This will happily answer on both IPV4 as well IPV6 (on a linux box at least).