Skip to content

Commit

Permalink
added IPv6 examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed May 26, 2012
1 parent b4b83e3 commit cce6448
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lib/Mojo/Server/Daemon.pm
Expand Up @@ -370,6 +370,9 @@ singleton.
List of one or more locations to listen on, defaults to the value of the
C<MOJO_LISTEN> environment variable or C<http://*:3000>.
# Listen on IPv6 interface
$daemon->listen(['http://[::1]:4000']);
# Listen on two ports with HTTP and HTTPS at the same time
$daemon->listen([qw(http://*:3000 https://*:4000)]);
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/UserAgent.pm
Expand Up @@ -555,9 +555,9 @@ Mojo::UserAgent - Non-blocking I/O HTTP 1.1 and WebSocket user agent
say "Error: $message";
}
# PUT request with content
# IPv6 PUT request with content
my $tx
= $ua->put('kraih.com' => {'Content-Type' => 'text/plain'} => 'Hello!');
= $ua->put('[::1]:3000' => {'Content-Type' => 'text/plain'} => 'Hello!');
# Grab the latest Mojolicious release :)
$ua->max_redirects(5)->get('latest.mojolicio.us')
Expand Down
2 changes: 1 addition & 1 deletion t/mojo/user_agent_online.t
Expand Up @@ -150,7 +150,7 @@ like $tx->res->headers->connection, qr/close/i, 'right "Connection" header';
# Oneliner
is g('mojolicio.us')->code, 200, 'right status';
is h('mojolicio.us')->code, 200, 'right status';
is h('mojolicio.us')->body, '', 'no body';
is h('mojolicio.us')->body, '', 'no content';
is p('mojolicio.us/lalalala')->code, 404, 'right status';
is g('http://mojolicio.us')->code, 200, 'right status';
is p('http://mojolicio.us')->code, 404, 'right status';
Expand Down

0 comments on commit cce6448

Please sign in to comment.