Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > HTTP::ProxySelector

Reply
Thread Tools

HTTP::ProxySelector

 
 
paddyxmurphy@googlemail.com
Guest
Posts: n/a
 
      03-17-2006
Hi,

I'm trying to get HTTP:roxySelector working and not having much luck.
The script I'm using to test the module is set out below. When I run
the script it returns the homepage of the proxy selected rather than
the site I'm trying to access. I'd appreciate any suggestions as to
what's going wrong.

Thanks.

Paddy

-----------------------------------------------------------------------------------------------------------------------------------
#!/usr/bin/perl

use strict;
use warnings;
use HTTP:roxySelector;
use LWP::UserAgent;

my $selector = HTTP:roxySelector->new(sites
=>['http://www.multiproxy.org/txt_anon/proxy.txt'],
testflag => 1,
num_tries => 10,
testsite => 'http://yahoo.com');
my $ua = LWP::UserAgent->new();
$selector->set_proxy($ua);
print 'Selected proxy: ',$selector->get_proxy(),"\n";

my $url = "http://yahoo.com";

my $response = $ua->get($url) or die $!;
my $content = $response->content() or die $!;

print "$content\n";

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments