LWP problems with authenticating proxy

LWP problems with authenticating proxy

am 15.10.2007 15:53:35 von Dan Rawson

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

Re: LWP problems with authenticating proxy

am 19.10.2007 13:05:58 von Tad McClellan

Dan Rawson 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/"

Re: LWP problems with authenticating proxy

am 19.10.2007 15:02:08 von Paul Lalli

On Oct 19, 7:05 am, Tad McClellan wrote:
> Dan Rawson 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