whittick has asked for the wisdom of the Perl Monks concerning the following question:
I stumbled accross a previous question from 2004 but didn't really want to resurrect it: http://www.perlmonks.org/?node_id=411687
I'm interested in the following code mentioned and I'm struggling to understand the two user/username and pass/password variables:
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 }; }
I Assume user and pass refer to the proxy credentials, what does username and password refer to?
Also if my proxy were a hostname rather than a web address would I just insert http:// before the hostname, or use the IP address, or just the hostname? I'm getting a bit confused!
Thanks.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: LWP::UserAgent proxy
by SimonPratt (Friar) on Feb 27, 2014 at 16:23 UTC | |
Re: LWP::UserAgent proxy
by thomas895 (Deacon) on Feb 28, 2014 at 07:31 UTC |