in reply to LWP::UserAgent and private proxy servers
It may be as simple as doing this:
$ua->proxy(["http"], "http://username:password@proxy.com");
Or you may find that this code (which does 401 authentication for you) does what you want.
my $ua = LWP::Custom->new(); $ua->proxy(["http"], "http://proxy.com"); $ua->set_basic_credentials( $user, $pass ); package LWP::Custom; use base 'LWP::UserAgent'; # add a set_basic_credentials method, using a closure to remember { my ( $username, $password ); sub set_basic_credentials{ ( $username, $password ) = @_[1..2] } sub get_basic_credentials{ $username, $password }; }
cheers
tachyon
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: LWP::UserAgent and private proxy servers
by theloanarranger (Acolyte) on Dec 03, 2004 at 03:41 UTC | |
|
Re^2: LWP::UserAgent and private proxy servers
by Anonymous Monk on Dec 02, 2004 at 10:27 UTC | |
by davidj (Priest) on Dec 03, 2004 at 02:53 UTC |