1use HTTP::Proxy;
2use HTTP::Proxy::BodyFilter::save;
3
4my $proxy = HTTP::Proxy->new(@ARGV);
5
6# save javascript files as we browse them
7$proxy->push_filter(
8    path => qr!/.js$!,
9    response => HTTP::Proxy::BodyFilter::save->new(
10        template => '%f',
11        prefix   => 'javascript',
12        multiple => 0,
13        keep_old => 1,
14    )
15);
16
17$proxy->start;
18
19