-
-
Notifications
You must be signed in to change notification settings - Fork 304
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
hydra-notify: enable IPv6 support #1395
base: master
Are you sure you want to change the base?
Conversation
HTTP::Server::PSGI uses the `ipv6` flag to decide between `IO::Socket::INET` and `IO::Socket::IP` (https://metacpan.org/dist/Plack/source/lib/HTTP/Server/PSGI.pm#L80-84) and (from IO/Socket/IP.pm): > C<IO::Socket::IP> - Family-neutral IP socket supporting both IPv4 and IPv6 so setting the `ipv6` flag makes it support both IPv4 and IPv6. Fixes NixOS#1394
I just compiled a version of hydra with a patch setting the flag, but it seems like it doesn't quite work that way:
|
I tested using: use strict;
use warnings;
use HTTP::Server::PSGI;
my $server = HTTP::Server::PSGI->new(
host => '::1',
# host => '127.0.0.1', # alternatively
port => 8080,
timeout => 1,
ipv6 => 1,
);
my $app = sub {
return [
'200',
[ 'Content-Type' => 'text/html' ],
[ 42 ],
];
};
$server->run($app); for me, both IPv4 and IPv6 appear to work, I'm using perl 5.38.2 and Plack 1.5.100. switching |
It might be useful to invoke the |
This is what happens after reading /etc/protocols:
Don't ask me what that nscd request is about, considering it mentions hosts I would assume that it's the equivalent of So with the "Invalid argument" not actually being a syscall returning EINVAL I am confused. Exactly the same thing happens when binding to |
For ipv6, glibc needs to look at interfaces (netlink) to figure out things like interface identifier. That's why you see that. |
HTTP::Server::PSGI uses the
ipv6
flag to decide betweenIO::Socket::INET
andIO::Socket::IP
(https://metacpan.org/dist/Plack/source/lib/HTTP/Server/PSGI.pm#L80-84)
and (from IO/Socket/IP.pm):
so setting the
ipv6
flag makes it support both IPv4 and IPv6.Fixes #1394