How to use different proxies for LWP::Parallel requests

Z

Zeke Koos

How do I use a different proxy for each request when using
LWP::parallel ?
I use the following subroutine to register the requests, but when I
call $ua->wait(20) all the requests go through the last proxy
registered.

Please help!

thanks
Koos


sub register_request {
my ($url,$proxy) = @_;
$ua->max_hosts(25);
$ua->agent('Mozilla/4.5');
$ua->proxy('http', 'http://'.$proxy);
my $req = HTTP::Request->new('GET', $url);
$ua->register ($req);
}
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top