simon.proctor has asked for the wisdom of the Perl Monks concerning the following question:
my $ua = LWP::UserAgent->new; # Proxy location $ua->proxy(['http', 'ftp'] => 'proxy-url'); # What we want - hardcoded my $req = HTTP::Request->new('GET',"target-url"); # Authenticate against the proxy - hardcoded $req->proxy_authorization_basic("domain/user", "password");
But I can't think of how to emulate that in Perl, or even if I should. I've also tried the other authentication methods that I could find (as well as mucking about with the headers) but that was just a case of shotgun debugging that I shouldn't really admit to :)URL url = new URL("target"); String authString = "domain/user:password"; String auth = "Basic " + new sun.misc.BASE64Encoder().encode(authStrin +g.getBytes()); URLConnection conn = url.openConnection(); conn.setRequestProperty("Proxy-Authorization", auth);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WEBSweeper Proxy Authentication
by PodMaster (Abbot) on Jul 17, 2002 at 10:36 UTC | |
by simon.proctor (Vicar) on Jul 17, 2002 at 11:00 UTC |