Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

http::proxy::engine(3pm) [debian man page]

HTTP::Proxy::Engine(3pm)				User Contributed Perl Documentation				  HTTP::Proxy::Engine(3pm)

NAME
HTTP::Proxy::Engine - Generic child process manager engine for HTTP::Proxy 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. This is a class method. AUTHOR
Philippe "BooK" Bruhat, "<book@cpan.org>". COPYRIGHT
Copyright 2005, Philippe Bruhat. LICENSE
This module is free software; you can redistribute it or modify it under the same terms as Perl itself. perl v5.12.4 2011-07-03 HTTP::Proxy::Engine(3pm)

Check Out this Related Man Page

HTTP::Proxy::FilterStack(3pm)				User Contributed Perl Documentation			     HTTP::Proxy::FilterStack(3pm)

NAME
HTTP::Proxy::FilterStack - A class to manage filter stacks DESCRIPTION
This class is used internally by "HTTP::Proxy" to manage its four filter stacks. From the point of view of "HTTP::Proxy::FilterStack", a filter is actually a ("matchsub", "filterobj") pair. The match subroutine (generated by "HTTP::Proxy"'s "push_filter()" method) is run against the current "HTTP::Message" object to find out which filters must be kept in the stack when handling this message. The filter stack maintains a set of buffers where the filters can store data. This data is appended at the beginning of the next chunk of data, until all the data has been sent. METHODS
The class provides the following methods: new( $isbody ) Create a new instance of "HTTP::Proxy::FilterStack". If $isbody is true, then the stack will manage body filters (subclasses of "HTTP::Proxy::BodyFilter"). select_filters( $message ) $message is the current "HTTP::Message" handled by the proxy. It is used (with the help of each filter's match subroutine) filter( @args ) This method calls all the currently selected filters in turn, with the appropriate arguments. filter_last() This method calls all the currently selected filters in turn, to filter the data remaining in the buffers in a single pass. will_modify() Return a boolean value indicating if the list of selected filters in the stack will modify the body content. The value is computed from the result of calling "will_modify()" on all selected filters. all() Return a list of all filters in the stack. eod() Used for END OF DATA bookkeeping. push() Push the given "[ match, filterobj ]" pairs at the top of the stack. insert( $idx, @pairs ) Insert the given "[ match, filterobj ]" pairs at position $idx in the stack. remove( $idx ) Remove the "[ match, filterobj ]" pair at position $idx in the stack. AUTHOR
Philippe "BooK" Bruhat, <book@cpan.org>. COPYRIGHT
Copyright 2002-2006, Philippe Bruhat. LICENSE
This module is free software; you can redistribute it or modify it under the same terms as Perl itself. perl v5.12.4 2011-07-03 HTTP::Proxy::FilterStack(3pm)
Man Page