| 17/38 |
© 2004 by Philippe "BooK" Bruhat.
|
Simple filters are created with HTTP::Proxy::BodyFilter::simple or HTTP::Proxy::HeaderFilter::simple.
These are filter factories that return a filter object given the filtering routine
$filter = HTTP::Proxy::BodyFilter::simple->new( sub { ${ $_[1] } =~ s/foo/bar/g; } );
The routine must have the same signature as the filter() method.
One can also use:
$filter = HTTP::Proxy::BodyFilter::simple->new( filter => \&filter_sub, start => \&start_sub, );
to define the other standard methods.
HTTP::Proxy::BodyFilter::simple and HTTP::Proxy::HeaderFilter::simple are conceptually identical