Re: HTTP proxy authentication

Gisle Aas <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.lwp
Message-ID <[email protected]>
Prateek <[email protected]> writes:

> $ua->proxy()
> is not accepting username and password as parameters.

Did you read the section pointed to the the URL I provided?  It says:

| Some proxies also require that you send it a username/password in
| order to let requests through. You should be able to add the
| required header, with something like this:
| 
|  use LWP::UserAgent;
| 
|  $ua = LWP::UserAgent->new;
|  $ua->proxy(['http', 'ftp'] => 'http://username:[email protected]');
| 
|  $req = HTTP::Request->new('GET',"http://www.perl.com");
| 
|  $res = $ua->request($req);
|  print $res->decoded_content if $res->is_success;
| 
| Replace proxy.myorg.com, username and password with something
| suitable for your site.


> On 21 Oct 2005 05:29:42 -0700, Gisle Aas <[email protected]> wrote:
> > Prateek <[email protected]> writes:
> >
> > > It seems that LWP::UserAgent does not support proxy with authentication.
> >
> > Proxies with authentication is supported.  See:
> >
> >    http://search.cpan.org/~gaas/libwww-perl-5.803/lwpcook.pod#PROXIES
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.