[HTTP-Recorder] Article / code mismatch?
Marc Mims
marc at questright.com
Fri Jun 11 22:37:17 EDT 2004
I must be missing something. I read the "Web Testing with
HTTP::Recorder article at:
http://www.perl.com/pub/a/2004/06/04/recorder.html
I created a script directly from the source in the article:
#!/usr/bin/perl
use HTTP::Proxy;
use HTTP::Recorder;
my $proxy = HTTP::Proxy->new();
# create a new HTTP::Recorder object
my $agent = new HTTP::Recorder;
# set the log file (optional)
$agent->file("/tmp/myfile");
# set HTTP::Recorder as the agent for the proxy
$proxy->agent( $agent );
# start the proxy
$proxy->start();
1;
Running it generates the error message:
Can't locate object method "file" via package "HTTP::Recorder" at
./http-recorder line 12.
I worked around that by providing a the file option to the
HTTP::Recorder constructor:
my $agent = new HTTP::Recorder(file => "/tmp/myfile");
That works, and I get the expected output in the log file.
But I've had no success attempting to access the HTTP::Recorder
Control Panel:
500 Can't connect to http-recorder:80 (Bad hostname
'http-recorder')
The article says: See Configuration Options for more information
about setting up the control URL. However, the link to Configuration
options is a dead link:
http://www.perl.com/pub/a/2004/06/04/recorder.html#config
Surely I'm missing something. I've seen messages on the list
containing the original script from the article with every indication
that it is working. What might I be missing?
-Marc
More information about the HTTP-Recorder
mailing list