LWP::UserAgent claims to support proxies, but I've had limited success. I can go through one proxy without problems:
But how can I chain multiple proxies? I've tried:use LWP::UserAgent; $ua = LWP::UserAgent->new; $ua->proxy("http", "http://proxy_host:proxy_port/"); my $req = HTTP::Request->new(GET => "http://www.google.com/"); my $res = $ua->request($req); if ($res->is_success) { print $res->content; } else { print "Bad luck this time\n"; }
The later only uses proxy2 and the former only uses proxy1!$ua->proxy("http", "http://proxy1_host:proxy1_port/ http://proxy2_host +:proxy2_port/"); $ua->proxy("http", "http://proxy1_host:proxy1_port/"); $ua->proxy("http", "http://proxy2_host:proxy2_port/");
In Internet Explorer, I can easily use multiple proxies using a syntax similar to my first attempt, so it seems that is the standard method of chaining proxies. Am I missing something obvious? How can LWP::UserAgent be told to chain proxies?
Should I use another module? I looked on CPAN and at the HTTP::Lite docs, but it from what I gather, this module only supports a single proxy too.
I'd really like to have proxy chaining support; do no Perl modules support it? Shall I roll my own HTTP implementation??
In reply to Chaining proxies with LWP::UserAgent by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |