POE::Component::Server::HTTP is a foundation of a POE HTTP Daemon.
SYNOPSIS
use POE::Component::Server::HTTP;
use HTTP::Status;
my $aliases = POE::Component::Server::HTTP->new(
Port => 8000,
ContentHandler => {
'/' => &handler1,
'/dir/' => sub { ... },
'/file' => sub { ... }
},
Headers => { Server => 'My Server' },
);
sub handler {
my ($request, $response) = @_;
$response->code(RC_OK);
$response->content("Hi, you fetched ". $request->uri);
return RC_OK;
}
POE::Kernel->call($aliases->{httpd}, "shutdown");
# next line isn't really needed
POE::Kernel->call($aliases->{tcp}, "shutdown");
POE::Component::Server::HTTP (PoCo::HTTPD) is a framework for building custom HTTP servers based on POE. It is loosely modeled on the ideas of apache and the mod_perl/Apache module.
It is built alot on work done by Gisle Aas on HTTP::* modules and the URI module which are subclassed.
PoCo::HTTPD lets you register different handler, stacked by directory that will be run during the cause of the request.
Product's homepage
Requirements:
· Perl
What's New in This Release: [ read full changelog ]
· Fixed for newer versions of POE where POE::Filter::HTTPD has changed representation from hashref to arrayref.