tags:

views:

114

answers:

3

I write this code :

 #!/usr/local/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([qw(http https)] => 'http://203.185.28.228:1080' #that is just socks:port);
 my $response = $ua->get("http://www.google.com");
 print $response->code,' ', $response->message,"\n";

but when i execute it i get this error: 500 Can't connect to 203.185.28.228:1080 (connect: timeout)

what am i going to do ?

A: 

I tested your script, its fine, however I got the only error is with

$ua->proxy([qw(http https)] => 'http://203.185.28.228:1080' #that is just socks:port);

The comments should be out of '()' i.e.

$ua->proxy([qw(http https)] => 'http://203.185.28.228:1080'); #that is just socks:port

Also, please check your internet connectivity. Below is the output i got from your script.

200 Assumed OK
Space
A: 

Is it SOCKS5? Does it require you to authenticate? (take a look at your Firefox/IE settings if they use the same proxy)

DVK
A: 

Octopus : is ur firewall enable ? can you help me about it .

Emma
You can get help with firewalls at http://serverfault.com.
Ether
I think this is not the original question. Please ask at serverfault.com as per Ether suggestion.
Space