Skip to content

Loading…

IPv6 listener support. #16

Open
wants to merge 1 commit into from

2 participants

@bfg

This simple patch adds IPv6 listener support. I'm also interested in implementing HTTP/TLS support via AnyEvent::TLS.

@dolmen

This patch uses tabs instead of spaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 22, 2011
  1. Added IPv6 listener support.

    Brane F. Gračnar committed
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/Twiggy/Server.pm
View
8 lib/Twiggy/Server.pm
@@ -65,8 +65,12 @@ sub _create_tcp_server {
my($host, $port, $is_tcp);
if ($listen =~ /:\d+$/) {
- ($host, $port) = split /:/, $listen;
- $host = undef if $host eq '';
+ # weed out port name
+ my @l = split(/:/, $listen);
+ $port = pop(@l);
+ $host = join(':', @l);
+ $host =~ s/[\[\]]+//g if defined $host;
+ $host = undef if defined $host && $host eq '';
$port = undef if $port == 0;
$is_tcp = 1;
} else {
Something went wrong with that request. Please try again.