Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   LWP problems with authenticating proxy (http://www.velocityreviews.com/forums/t905024-lwp-problems-with-authenticating-proxy.html)

Dan Rawson 10-15-2007 01:53 PM

LWP problems with authenticating proxy
 
We have a proxy server which requires a user name and password. I'm
attempting to use LWP::Simple to get some web pages from external hosts with
no luck . . . .

I can get the proxy to work correctly with an external tool like wget, which
has proxy_user and proxy_password command-line options.

Using LWP::Simple always produces the error message:

501 Protocol scheme '' is not supported

I've looked through the LWP documentation, but I don't see how to set the
proxy user/password :-((

Thanks!

Dan

Tad McClellan 10-19-2007 11:05 AM

Re: LWP problems with authenticating proxy
 
Dan Rawson <drawson1.take.this.out@earthlink.dot.net> wrote:

> We have a proxy server which requires a user name and password. I'm
> attempting to use LWP::Simple



What you are trying to do goes beyond "simple", so you will need
to use a more full-featured module instead.


> I've looked through the LWP documentation, but I don't see how to set the
> proxy user/password :-((



Search for "credentials" in

perldoc LWP::UserAgent


--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"

Paul Lalli 10-19-2007 01:02 PM

Re: LWP problems with authenticating proxy
 
On Oct 19, 7:05 am, Tad McClellan <ta...@seesig.invalid> wrote:
> Dan Rawson <drawson1.take.this....@earthlink.dot.net> wrote:
> > We have a proxy server which requires a user name and password. I'm
> > attempting to use LWP::Simple

>
> What you are trying to do goes beyond "simple", so you will need
> to use a more full-featured module instead.


No he won't. LWP::Simple initializes its underlying User Agent by
calling $ua->env_proxy(). LWP::UserAgent's documentation shows that
the env_proxy() method looks for the $http_proxy environment variable.

Just set http_proxy before loading up LWP::Simple, and you'll be fine.

Paul Lalli



All times are GMT. The time now is 07:11 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.