Proxy method does not work using LWP::UserAgent for HTTPS request
- From: shallyee@xxxxxxxxx
- Date: Tue, 9 Sep 2008 03:53:25 -0700 (PDT)
I have following sample getting file via HTTPS protocal using
LWP::UserAgent module.
#!/usr/bin/perl
use LWP::UserAgent;
use LWP::Debug qw(+);
$uri = $ARGV[0];
$ua = LWP::UserAgent->new;
$ua->timeout(10);
#$ENV{HTTPS_PROXY} = 'myproxy.mydomain:8080'; # (A) this works
$ua->proxy('https', 'myproxy.mydomain:8080'); # (B) this
don't works at all
$response = $ua->get($uri);
if ($response->is_success) {
print $response->decoded_content;
}
else {
die $response->status_line;
}
Setting HTTPS_PROXY environment variable works fine, but
use $ua->proxy setting proxy don't work. It gaives following trace.
koroke:~/tmp$ https_get.pl https://www.somedomain.jp/
LWP::UserAgent::new: ()
LWP::UserAgent::proxy: https myproxy.mydomain:8080
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET https://www.somedomain.jp/
LWP::UserAgent::_need_proxy: Proxied to myproxy.mydomain:8080
LWP::UserAgent::request: Simple response: Not Implemented
501 Protocol scheme '' is not supported at https_get.pl line 17.
Who can explain that's different?
Thanks.
.
- Follow-Ups:
- Prev by Date: "tailing" utmp(x)?
- Next by Date: Re: "tailing" utmp(x)?
- Previous by thread: "tailing" utmp(x)?
- Next by thread: Re: Proxy method does not work using LWP::UserAgent for HTTPS request
- Index(es):