GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  HTTP::PROXY::ENGINE (3)

.ds Aq ’

NAME

HTTP::Proxy::Engine - Generic child process manager engine for HTTP::Proxy

CONTENTS

SYNOPSIS



    use HTTP::Proxy;

    # use the default engine for your system
    my $proxy = HTTP::Proxy->new();

    # choose one
    my $proxy = HTTP::Proxy->new( engine => Old );



DESCRIPTION

The HTTP::Proxy::Engine class is a front-end to actual proxy engine classes.

The role of an engine is to implement the main fork+serve loop with all the required bookkeeping. This is also a good way to test various implementation and/or try out new algorithms without too much difficulties.

METHODS

new() Create a new engine. The parameter engine is used to decide which kind of engine will be created. Other parameters are passed to the underlying engine.

This method also implement the subclasses constructor (they obviously do not need the engine parameter).

CREATING YOUR OWN ENGINE

It is possible to create one’s own engine, by creating a simple subclass of HTTP::Proxy::Engine with the following methods:
start() This method should handle any initialisation required when the engine starts.
run() This method is the main loop of the master process. It defines how child processes are forked, checked and killed.

The engine MUST have a run() method, and it will be called again and again until the proxy exits.

$self->proxy->daemon returns the listening socket that can accept() connections. The child must call $self->proxy->serve_connections() on the returned socket to handle actual TCP connections.

stop() This optional method should handle any cleanup procedures when the engine stops (typically when the main proxy process is killed).
A subclass may also define a %defaults hash (with our) that contains the default values for the fields used internaly.

METHODS PROVIDED TO SUBCLASSES

HTTP::Proxy::Engine provides the following methods to its subclasses:
proxy() Return the HTTP::Proxy object that runs the engine.
max_clients() Get or set the maximum number of TCP clients, that is to say the maximum number of forked child process.

Some engines may understand a value of 0 as do not fork at all. This is what HTTP::Proxy::Engine::Legacy does.

make_accessors( @names ) Create accessors named after @names in the subclass package. All accessors are read/write. This is a utility method.

<B>This is a class method.B>

AUTHOR

Philippe BooK Bruhat, <book@cpan.org>.

COPYRIGHT

Copyright 2005-2015, Philippe Bruhat.

LICENSE

This module is free software; you can redistribute it or modify it under the same terms as Perl itself.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 HTTP::PROXY::ENGINE (3) 2015-06-16

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.