Have a web-page with very complex structure and javascript logic with many ajax calls, some requests only got a respond pure (applicaton/json) objects, some ajax gets html and so on... ;(
Need analyze the full communication between the browser and server, so decided write a perl-proxy what "simple" dump all text communication in any direction (requests and responses too).
Found the HTTP::Proxy module, but im totally confused with the filters.
The basic code:
use strict;
use warnings;
use HTTP::Proxy;
my $proxy = HTTP::Proxy->new( port => 3128 );
$proxy->start;
works nicely, but i havn't any idea how to write the filters for it.
The "eg" directory in the distribution have milion complicated examples how to modify the response body contents and so on, but the basic dump_all_communication
is missing.
Can anybody guide me, how to write a simple filter for:
- dump out all http-requests what are going from browser to server
- and dump out the content of all responses, when they have mime:
text/*
andapplication/json
andapplication/x-javascript
(or better: for anything but no images, pdf and flash)
Here is similiar question, but it is want filter JSON and me want more simple - dump everything (all requests and all responses (but no images))