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::BodyFilter::lines(3pm)			User Contributed Perl Documentation		       HTTP::Proxy::BodyFilter::lines(3pm)

NAME
HTTP::Proxy::BodyFilter::lines - A filter that outputs only complete lines SYNOPSIS
use HTTP::Proxy::BodyFilter::lines; use MyFilter; # this filter only works on complete lines my $filter = MyFilter->new(); # stack both filters so that they'll handle text/* responses $proxy->push_filter( mime => 'text/*', response => HTTP::Proxy::BodyFilter::lines->new, response => $filter ); # I want my lines to end with '!' # This is equivalent to $/ = '!' in a normal Perl program my $lines = HTTP::Proxy::BodyFilter::lines->new('!'); DESCRIPTION
The HTTP::Proxy::BodyFilter::lines filter makes sure that the next filter in the filter chain will only receive complete lines. The "chunks" of data received by the following filters with either end with " " or will be the last piece of data for the current HTTP message body. You can change the idea the filter has of what is a line by passing to its constructor the string it should understand as line ending. " " is the default value. my $filter = HTTP::Proxy::BodyFilter::lines->new( $sep ); This is similar to modifying $/ in a Perl program. In fact, this filter has a behaviour so similar to modifying $/ that it also knows about "paragraph mode" and "record mode". Note that the "slurp" mode is not supported. Please use HTTP::Proxy::BodyFilter::complete to enable the generic store and forward filter mechanism. METHODS
This filter defines the following methods, which are automatically called: init() Initialise the filter with the EOL information. filter() Keeps unfinished lines for later. will_modify() This method returns a false value, thus indicating to the system that it will not modify data passing through. SEE ALSO
HTTP::Proxy, HTTP::Proxy::BodyFilter. AUTHOR
Philippe "BooK" Bruhat, <book@cpan.org>. COPYRIGHT
Copyright 2003-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::BodyFilter::lines(3pm)
Man Page