|
Posted by Juha Laiho on January 11, 2006, 11:27 am
If you were Registered and logged in, you could reply and use other advanced thread options
>I have a script on Windows which uses LWP to make a simple GET request
>through a proxy:
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
> use LWP::UserAgent;
>
> my $url = "https://mysite.com";
>
> my $ua = LWP::UserAgent->new;
> $ua->proxy(['http', 'https'] => 'http://myproxy.org:80');
> my $response = $ua->get( $url );
>
> $response->is_success or
> die "Failed to GET '$url': ", $response->status_line;
>
> print $response->as_string, "\n";
>
>I also have Crypt::SSLeay installed so that I can access https sites.
>When I try to run the script as above, it prints some HTTP headers and
>an HTML-formatted error message from the firewall server which says
>"Scheme not supported".
Could it be that LWP does not support HTTP 'CONNECT' method for working
with proxies? As it is this what is needed to proxy https requests:
you first make a 'CONNECT' request to the proxy, and then place your
https traffic in the connection that the proxy opened for you.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
|