in reply to Re^3: proxy problwm LWP
in thread proxy problwm LWP

hello

will you see for one more time? its still not working

now the script is :

use strict; use warnings; use LWP::UserAgent; my $ua = LWP::UserAgent->new(); $ua->proxy(['http', 'ftp'], 'http://192.168.64.1:3128/'); my $req = HTTP::Request->new('GET','https://twitter.com/?lang=en'); my $res = $ua->request($req); print $res->status_line;
and on run shows error message

500 Can't connect to twitter.com:443 (Bad hostname)

thanks

Replies are listed 'Best First'.
Re^5: proxy problwm LWP
by Corion (Patriarch) on May 18, 2015 at 11:43 UTC

    https is not http:

    $ua->proxy(['http', 'ftp'], 'http://192.168.64.1:3128/');
    my $req = HTTP::Request->new('GET','https://twitter.com/?lang=en');
      actually I wrote https as the message is same when thereis http://twitter.com in http request and I thought because site address is wrong that is why it is giving message

      even now changing https to http showing the same error message "500 can't connect___:443(bad hostname)" and another time it was giving error message "501 that https is not installed" so after installing I changed the address to https

        If you want LWP::UserAgent to use a proxy for https connections, you must tell it so in the call to $ua->proxy().