【发布时间】:2015-01-04 19:14:18
【问题描述】:
#!/usr/bin/perl
use strict;
use LWP::UserAgent;
my $ua = new LWP::UserAgent(agent => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.5) Gecko/20060719 Firefox/1.5.0.5');
$ua->proxy('http' => 'socks://188.26.223.189:1080');
my $response = $ua->get('http://example.com');
print $response->code,' ', $response->message,"\n";
print $response->decoded_content . "\n";
我尝试通过 socks-proxy 连接到网站,但出现错误:500 Can't connect to example.com:80 我做错了什么?
【问题讨论】:
-
你安装了Perl模块LWP::Protocol::socks吗?
-
是的,我安装了它。
-
看看this。除了
[ qw/http https/ ],它看起来几乎一样。 -
这也行不通。
-
当。我希望这里能出现奇迹。看看你是否可以“telnet”到代理(
$ telnet 188.26.223.189 1080)。我想知道您是否需要代理上的用户名和密码?