Permalink
Browse files

[Web::Handler::HTTPDaemon] generalized the call

Now not only the port, but also the host name is a parameter.
  • Loading branch information...
1 parent 92f7b99 commit e24dabb7e5af79e446e4dc4107eb4a389313925f @masak committed Oct 24, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/Web/Handler/HTTPDaemon.pm
@@ -3,8 +3,8 @@ use v6;
use HTTP::Daemon;
class Web::Handler::HTTPDaemon {
- method run(&app, :$port = 8888) {
- my HTTP::Daemon $d .= new(LocalPort => $port);
+ method run(&app, :$host = 'localhost', :$port = 8888) {
+ my HTTP::Daemon $d .= new(LocalAddr => $host, LocalPort => $port);
while my $c = $d.accept and my HTTP::Request $r = $c.get_request {
my $qs = $r.url.path ~~ / '?' (.*) $/ ?? $0 !! '';
my %env = { "QUERY_STRING" => $qs };

0 comments on commit e24dabb

Please sign in to comment.