IOMux::HTTP::Server - IOMux and LWP based HTTP server
IOMux::HTTP::Server is a IOMux::Service::TCP is a IOMux::Handler::Service is a IOMux::Handler
my $mux = IOMux::Poll->new; my $conn = IOMux::HTTP::Server->new(handler => \&h); $mux->add($conn); $mux->loop;
This module implements a basic HTTP connection handler on a socket, using IOMux as basis. This server takes all requests in a single process, because it is shaped around a select or poll system call: multiple clients send data to a single process in parallel.
select
poll
The server understands protocols HTTP version 0.9, 1.0, and 1.1. See HTTP::Server::Multiplex for a extended server implementation, mimicing Apache. The connection logic is implemented in IOMux::HTTP::Service.
See the examples/ directory in the distribution for a detailed template for a complete HTTP server.
One object will accept connections on one socket. When you have more sockets to listen on, each needs its own object.
You may extend the connection implementation.
-Option --Defined in --Default conn_opts IOMux::Service::TCP [] conn_type IOMux::Service::TCP IOMux::HTTP::Service fh IOMux::Handler <required> handler <required> name IOMux::Handler 'listen tcp $host:$port'
The CODE points to the routine which get called when a new connection gets initialized.
This module is part of IOMux-HTTP distribution version 0.11, built on January 27, 2011. Website: http://perl.overmeer.net/ All modules in this suite: "Any::Daemon", "IOMux", and "IOMux::HTTP".
Please post questions or ideas to perl@overmeer.net
Copyrights 2011 by Mark Overmeer. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html
To install IOMux::HTTP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IOMux::HTTP
CPAN shell
perl -MCPAN -e shell install IOMux::HTTP
For more information on module installation, please visit the detailed CPAN module installation guide.