Skip to content

Commit

Permalink
explain default listen value
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 15, 2014
1 parent fb0bd7e commit 68d7635
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/Mojo/Server/Daemon.pm
Expand Up @@ -360,18 +360,21 @@ L<Mojo::IOLoop> singleton.
List of one or more locations to listen on, defaults to the value of the
MOJO_LISTEN environment variable or C<http://*:3000>.
# Allow multiple servers to use the same port (SO_REUSEPORT)
$daemon->listen(['http://*:8080?reuse=1']);
# Listen on all IPv4 interfaces
$daemon->listen(['http://*:3000']);
# Listen on all IPv4 and IPv6 interfaces
$daemon->listen(['http://[::]:3000']);
# Listen on IPv6 interface
$daemon->listen(['http://[::1]:4000']);
# Listen on all interfaces (IPv4 and IPv6)
$daemon->listen(['http://[::]:3000']);
# Listen on IPv4 and IPv6 interfaces
$daemon->listen(['http://127.0.0.1:3000', 'http://[::1]:3000']);
# Allow multiple servers to use the same port (SO_REUSEPORT)
$daemon->listen(['http://*:8080?reuse=1']);
# Listen on two ports with HTTP and HTTPS at the same time
$daemon->listen([qw(http://*:3000 https://*:4000)]);
Expand Down

0 comments on commit 68d7635

Please sign in to comment.