Re: Passing username and password using LWP::UserAgent



I have very similar code, which is working.

One difference is that I am not using the
diamond operator to read from the proxy
page (which I'm not sure works?). I have a
line like:

$ua->proxy('http','http://myProx:myPort/proxy.pac');

What happens when you point your browser to the two
URL's (the proxy page and the GET page); do you get
what you expect?

Can you set an environment / shell variable and do a wget (*nix) or
GET (DOS)?

Keith



kill bill wrote:
Hi,
I ve written a perl script which sends the user name and password
through a proxy for authentication,the problem is that after it is
getting authenticated it is not showing the contents of the desired
page i.e the page which the user wants to visit is not being displayed

code

use LWP::UserAgent;

$ua = new LWP::UserAgent;

$ua->proxy(['http'] => '<http://abc.com:389>');

$req = new HTTP::Request 'GET','http://xyz.com';

$req->proxy_authorization_basic('username','password');

$res = $ua->request($req);

print $res->content if $res->is_success;
print $ua->request($req)->as_string;

code

the problem with the above code is that it does not directs the user to
'http://xyz.com"; after authentication can anybody help me out please..

.



Relevant Pages

  • Re: Proxy server with HttpListener
    ... class using sockets that will write the authentication details to your ... that captured HTTP request to your company proxy. ... How can I send the HttpListenerRequest to the internet and put the ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: httpwebrequest with https behind proxy with authentication
    ... contact Microsoft Customer Support ... httpwebrequest with https behind proxy with authentication ... Our proxy server uses NTLM authentication and as you suggested I ...
    (microsoft.public.dotnet.framework)
  • RE: HttpWebRequest over Https Via Proxy Fails using NTLM
    ... request a resource over HTTPS is failing following the installation of a new ... proxy server on our internal network with 407 Proxy Authentication Required. ... Is there any way to debug the ntlm authentication module to see exactly what ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Wi-fi hotspot implementations
    ... FreeBSD, using php and mysql for the authentication, squid for the ... have authenticated full access through the proxy. ... This strikes me as a bit of overkill for a coffee shop. ... Proxy servers are nice for security and anonymity, ...
    (alt.internet.wireless)
  • Re: httpwebrequest with https behind proxy with authentication
    ... Our proxy server uses NTLM authentication and as you suggested I modified the code as follows: ... I still receive "The remote server returned an error: Proxy Authentication Required." ... and it works if I use http instead of https or if I disable authentication on the proxy ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework)