NAME
HTTP::Server::Simple
WARNING
This code is still undergoing active development. Particularly, the API is not yet frozen. Comments about the API would be greatly appreciated.
SYNOPSIS
use warnings;
use strict;
use HTTP::Server::Simple;
my $server = HTTP::Server::Simple->new();
$server->run();
DESCRIPTION
This is a simple standalone http dameon. It doesn't thread. It doesn't fork. It does, however, act as a simple frontend which can turn a CGI into a standalone web-based application.
new
port [NUMBER]
Takes an optional port number for this server to listen on.
Returns this server's port. (Defaults to 8080)
background
Run the server in the background. returns pid.
run
Run the server. If all goes well, this won't ever return, but it will start listening for http requests
handle_request CGI
This routine is called whenever your server gets a request it can handle. It's called with a CGI object that's been pre-initialized. You want to override this method in your subclass
setup_listener
This routine binds the server to a port and interface
build_cgi_env
build up a CGI object out of a param hash
print_banner
This routine prints a banner before the server request-handling loop starts.
AUTHOR
Copyright (c) 2004-2005 Jesse Vincent, jesse@bestpractical.com. All rights reserved.
Marcu Ramberg contributed tests, cleanup, etc
BUGS
There certainly are some. Please report them via rt.cpan.org
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.