I tried using the perl module AnyEvent::HTTP to make asynchronous HTTP requests by following this post: http://www.windley.com/archives/2012/03/asynchronous_http_requests_in_perl_using_anyevent.shtml
However, I'm not able to get it working through proxies...
my $request;
my $host = '<userid>:<pswd>@<proxyip>';
my $port = '<proxyport>';
my $headers = { ...
'Accept-Language'=> 'en-us,en;q=0.5',
'Accept-Charset'=> 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
'Keep-Alive' => 300,
};
$request = http_request(
GET => $url,
timeout => 120, # seconds
headers => $headers,
proxy => [$host, $port],
mymethod
);
$cv->end;
$cv->recv;
I get the following error for the above code (after substituting with authentication details for the proxy)
{
'Reason' => 'No such device or address',
'URL' => 'www.google.com',
'Status' => 595
};
Without the proxy argument of the request, it works. From the CPAN page http://metacpan.org/pod/AnyEvent::HTTP,
595 - errors during connection establishment, proxy handshake
Please help me identify the problem with this code. Thanks!