http://qs321.pair.com?node_id=363098

rmb has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Help and advice required please. This short script works ok on internal web pages but how do I add proxy authentication? and should the username and password be in plain text or encoded in some way? The proxy server is windows based.
#!/usr/local/bin/perl use LWP::UserAgent; use HTTP::Request; use HTTP::Response; my $ua = new LWP::UserAgent; ##$ua->proxy('http', 'http://my_domain\my_username:my_passwd@10.10.10. +10:8080/'); $ua->proxy('http', 'http://10.10.10.10:8080/'); $ua->no_proxy('localdomain.com'); my $request = new HTTP::Request('GET', $ARGV[0]); ##$request->proxy_authorization_basic( 'my_domain\my_username', 'my_pa +sswd' ); my $response = $ua->request($request); if ($response->is_success) { print $response->content; } else { print $response->error_as_HTML; }
Thanks, rmb