The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

App::HTTP_Proxy_IMP::IMP::FakeResponse - return alternativ response header and body for specific URIs

SYNOPSIS

  # listen on 127.0.0.1:8000 
  # to hijack google analytics put alternative response into 
  # myroot/www.google-analytics.com/ga.js or
  # myroot/www.google-analytics.com:80/ga.js or

  $ perl bin/imp_http_proxy --filter FakeResponse=root=myroot 127.0.0.1:8000

DESCRIPTION

This module is used to hijack specific URIs and return a different response. It works by replacing the origin target in the request header with internal://imp, which causes App::IMP_HTTP_Proxy_IMP to inject a dummy HTTP response header and body into the data stream, instead of contacting the original server. This dummy response is than replaced with the alternative response.

The format and file name for the alternative responses is the same as in Net::IMP::HTTP::SaveResponse, see there for details.

new_analyzer has the following arguments:

root

Specifies the base directory, where the alternative responses are located.

ignore_parameters

Ignore query string or post data when computing the file name.

AUTHOR

Steffen Ullrich <sullr@cpan.org>