Click here to get back home

HTTP::ProxySelector

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
HTTP::ProxySelector paddyxmurphy 03-17-2006
Posted by paddyxmurphy on March 17, 2006, 9:51 am
Please log in for more thread options


Hi,

I'm trying to get HTTP::ProxySelector 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::ProxySelector;
use LWP::UserAgent;

my $selector = HTTP::ProxySelector->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";


Similar ThreadsPosted
XML-RPC over HTTP with SSL January 17, 2005, 10:08 pm
Using HTTP::Proxy September 23, 2004, 5:41 am
HTTP::Proxy and not using 127.0.0.1 May 11, 2006, 6:10 pm
HTTP::TreeBuilder problems July 29, 2004, 12:19 am
HTTP::Cache module September 26, 2004, 8:37 am
http request headers October 1, 2004, 12:47 pm
http headers with CGI.pm and mod_perl (bug?) November 10, 2004, 10:19 pm
HTTP 1.1 Support in LWP / ParallelUA February 11, 2006, 2:20 pm
Help regarding HTTP::Request:POST February 24, 2006, 11:31 pm
Combining HTTP:Daemon and CGI May 27, 2006, 5:07 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap