HTTP::ProxySelector

Discussion in 'Perl Misc' started by paddyxmurphy@googlemail.com, Mar 17, 2006.

  1. Guest

    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";
     
    , Mar 17, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jiong Feng
    Replies:
    0
    Views:
    843
    Jiong Feng
    Nov 19, 2003
  2. Paul Glavich [MVP - ASP.NET]
    Replies:
    0
    Views:
    449
    Paul Glavich [MVP - ASP.NET]
    Jun 20, 2004
  3. T. Regan
    Replies:
    3
    Views:
    712
    T. Regan
    Jun 21, 2004
  4. NNTP
    Replies:
    2
    Views:
    992
    =?Utf-8?B?S2V2aW4gVG9kZA==?=
    Mar 18, 2005
  5. larkpics
    Replies:
    9
    Views:
    9,018
    Patrick.O.Ige
    Oct 22, 2005
Loading...

Share This Page