Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: LWP::UserAgent and private proxy servers

by tachyon (Chancellor)
on Dec 02, 2004 at 08:40 UTC ( #411687=note: print w/replies, xml ) Need Help??

in reply to LWP::UserAgent and private proxy servers

It may be as simple as doing this:

$ua->proxy(["http"], "");

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"], ""); $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 }; }



Replies are listed 'Best First'.
Re^2: LWP::UserAgent and private proxy servers
by theloanarranger (Acolyte) on Dec 03, 2004 at 03:41 UTC

    Thank you so much for your help. The first idea didn't work because LWP::UserAgent couldn't handle the username and password within the url, but the second idea worked wonderfully and you showed me how to extend classes.
    Thanks again,

    Matt Schick
Re^2: LWP::UserAgent and private proxy servers
by Anonymous Monk on Dec 02, 2004 at 10:27 UTC
    is that documented?
      It sure is. Read the proxy attributes section of the documentation.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://411687]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2017-06-26 04:19 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (572 votes). Check out past polls.