#!perl -w
use strict;
use HTTP::Proxy;
use HTTP::Proxy::HeaderFilter::simple;
use Data::Dumper;
# initialisation
my $proxy = HTTP::Proxy->new( port => 3128 );
# convert italics to bold
our $count = 0;
$proxy->push_filter(
mime => 'text/html',
request => HTTP::Proxy::HeaderFilter::simple->new(sub{ warn $main::count++ . "\n" })
);
# this is a MainLoop-like method
$proxy->start;
package RequestFilter;
use strict;
use base 'HTTP::Proxy::HeaderFilter';