#!/usr/bin/perl # Copyright 2012 C & P Bibliography Services # # This is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # # This is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, # Suite 330, Boston, MA 02111-1307 USA # # Usage: httprecorder.pl & # # This script runs an HTTP Recorder proxy on port 9000, and saves the resulting # WWW::Mechanize script to /tmp/kohalog use HTTP::Proxy; use HTTP::Recorder; my $proxy = HTTP::Proxy->new( port => 9000, host => undef ); # create a new HTTP::Recorder object my $agent = new HTTP::Recorder; # set the log file (optional) $agent->file("/tmp/kohalog"); # set HTTP::Recorder as the agent for the proxy $proxy->agent( $agent ); # start the proxy $proxy->start();