in reply to Commands for IO::Socket
Remember next time tho to look for a wheel before you build one. *grins* good coding.use HTTP::Daemon; use HTTP::Status; my $d = new HTTP::Daemon; print "Please contact me at: <URL:", $d->url, ">\n"; while (my $c = $d->accept) { while (my $r = $c->get_request) { if ($r->method eq 'GET' and $r->url->path eq "/aaa.mp3") { $c->send_file_response("aaa.mp3"); } else { $c->send_error(RC_FORBIDDEN) } } $c->close; undef($c); }
|
|---|