2
我使用Perl模塊AnyEvent :: HTTP按照這個帖子進行異步HTTP請求的嘗試:http://www.windley.com/archives/2012/03/asynchronous_http_requests_in_perl_using_anyevent.shtmlPerl的AnyEvent :: HTTP請求失敗
不過,我沒有能夠得到它通過代理工作...
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;
我得到了上面的代碼下面的錯誤
{
'Reason' => 'No such device or address',
'URL' => 'www.google.com',
'Status' => 595
};
沒有代理ARG(與代理認證細節代之後)它的請求,它的作品。從CPAN頁http://metacpan.org/pod/AnyEvent::HTTP,
595 - 連接建立過程中出現錯誤,代理握手
請幫我找出這個代碼的問題。謝謝!