陈钢 > HTTP-Server-Encrypt > HTTP::Server::Encrypt

Download:
HTTP-Server-Encrypt-0.12.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.12   Source  

NAME ^

HTTP::Server::Encrypt - HTTP server can encrypt BODY section

SYNOPSIS ^

  use HTTP::Server::Encrypt qw(http_server_start);

  my %http_conf;
  $http_conf{'port'} = 80;
  $http_conf{'docroot'} = "/var/www/htdoc/";
  $http_conf{'blowfish_key'} = "somekey";
  $http_conf{'blowfish_encrypt'} = 'yes';
  $http_conf{'blowfish_decrypt'} = 'yes';
  http_server_start(\%http_conf);

DESCRIPTION ^

A pure Perl WebServer with features below.

EASY SETUP ^

Usage of HTTP::Server::Encrypt is very simple.

http_server_start(%params)

To set up a new HTTP Server, just call the http_server_start method. It will run as a daemon.

http_server_start accepts the following named parameters in %params:

HOW TO WRITE SCRIPTS ^

Only PERL script support.

Just scripts in docroot.

For example:

If you docroot set to /var/www/html/.

Request GET /script.pl will be responsed by /var/www/html/script.pl.

There is some vars can be used in the script.

CGI SUPPORT ^

If you write scripts in Python or C or something not PERL,

You may want use CGI standard, then you can write

        use HTTP::Server::Encrypt::CGI;

Instead of

        use HTTP::Server::Encrypt;

Then you just put you CGI applications in docroot.

More information in HTTP::Server::Encrypt::CGI.

TIPS ^

If your want do things after http_server_start method, you may want this:

    my $parent = fork();
    unless($parent)
    {
        http_server_start(\%http_conf);
        exit 1;
    }

    my $pidfile = __FILE__ . ".pid";
    for(1..9)
    {
        last if -s $pidfile;
        sleep 1;
    }

    ... #server already up. do your things ...

AUTHOR ^

Written by ChenGang, yikuyiku.com@gmail.com

http://blog.yikuyiku.com/

COPYRIGHT ^

Copyright (c) 2011 ChenGang. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO ^

HTTP::Daemon, HTTP::Server::Simple, HTTP::Server::Encrypt::CGI

syntax highlighting: