proxy authentication and little patch

"Bas Bloemsaat" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.lwp
Message-ID <[email protected]>
Hi,

Tonight I was stumbling over authentication, trying to get through a proxy
with LWP::UserAgent.

The only way I could get this working was by overriding
get_basic_credentials, which seemed a bit overkill for just passing through
a proxy. Upon examination, I found that get_basic_credentials just returned
when encountering a proxy, not bothering to look anything up. It doesn't
have a URL to lookup at that point either.

A little editing made it possible to use:
$ua->credentials('proxy', 'proxy', "username", "password" );
to set the username and password for the proxy to use, which saves hassling
with overriding the function.

Therefor I propose this solution for general use, the patch is attached.

Regards,
Bas
patchProxyAuth.diff (application/octet-stream, 149 B)
563c563,565
<     return if $proxy;
---
>     if ($proxy) {
>         return @{ $self->{'basic_authentication'}{"proxy"}{"proxy"} };
>     };
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.