Author image Philippe Bruhat (BooK)


HTTP::Proxy::Builder - Assemble several proxies into a single one.


HTTP::Proxy::Builder can be used in a single proxy script:

    use HTTP::Proxy::Builder;

    # The exported $proxy variable is a valid HTTP::Proxy object,
    # initialized when HTTP::Proxy::Builder is first used
    $proxy->push_filter( ... );

    # no call to $proxy->start() is needed

or to build larger proxies from individual ones:

    use HTTP::Proxy::Builder;

    proxy_load( '' );
    proxy_load( '' );


Until now, HTTP::Proxy programs started as a simple one-purpose program, and quickly grew out of that when one started to "enhance" more and more web sites. Sometimes not all the features are needed, and commenting out large sections of a big proxy script is not what one would call flexible.

With HTTP::Proxy::Builder it is now possible to keep proxyies with different functionalities or aimed a different websites in separate programs, and to combine them at will using a wrapper program that aggregates them.

HTTP::Proxy::Builder lets one build a fully working proxy, that is also integrable into a larger script that loads all the individual proxies and set them up as a single configurable multi-purpose proxy.

The build_proxy command included in this distribution provides such a flexible combining proxy.


HTTP::Proxy::Builder exports the $proxy variable.

By default, it is configured like this:

    $proxy = HTTP::Proxy->new( @args );

Where @args is the content of @ARGV up to the first -- option (which is removed, to allow further processing by the main program).


HTTP::Proxy::Builder exports the following functions:

proxy_load( $file, ... )

Runs the script contained in the given file names. The proxy script itself must use HTTP::Proxy::Builder to work as expected.

This function will run one or several external files given by name: this is potentially dangerous! Use at your own risk.

proxy_abort( $reason )

Abort the proxy start. To be used when a proxy script must not be run.

Note that calling die() in your script will automatically abort() (not in the context of an eval, though).


HTTP::Proxy, code in the eg/ directory.


Philippe Bruhat (BooK), <>.


Please report any bugs or feature requests to bug-http-proxy-builder at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc HTTP::Proxy::Builder

You can also look for information at:


Copyright 2008 Philippe Bruhat (BooK), all rights reserved.


This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.