reciter has asked for the wisdom of the Perl Monks concerning the following question:
Hello
I am trying to run this script. but it saying "500 Can't connect to twitter.com:80 (Bad hostname)"
actually I have to run perl script which access http and ftp but before that I am trying to find out which way proxy settings should be written.LWP::Simple use LWP::UserAgent; use Net::SSL (); # From Crypt-SSLeay $Net::HTTPS::SSL_SOCKET_CLASS = "Net::SSL"; # Force use of Net::SSL $ENV{HTTP_PROXY} = 'http://defaultgatewayusedbymyPC:port'; $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0; my $ua = LWP::UserAgent->new(); my $req = HTTP::Request->new('GET','http://twitter.com'); my $res = $ua->request($req); print $res->status_line;
But alas its not working. I have tried many ways, i think I am missing something
Please Help me
If possible please reply as early as possible
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: proxy problwm LWP
by hdb (Monsignor) on May 16, 2015 at 16:50 UTC | |
by reciter (Novice) on May 18, 2015 at 06:25 UTC | |
by hdb (Monsignor) on May 18, 2015 at 07:21 UTC | |
by reciter (Novice) on May 18, 2015 at 11:37 UTC | |
by Corion (Patriarch) on May 18, 2015 at 11:43 UTC | |
|