LWP problems with authenticating proxy

Discussion in 'Perl Misc' started by Dan Rawson, Oct 15, 2007.

  1. Dan Rawson

    Dan Rawson Guest

    We have a proxy server which requires a user name and password. I'm
    attempting to use LWP::Simple to get some web pages from external hosts with
    no luck . . . .

    I can get the proxy to work correctly with an external tool like wget, which
    has proxy_user and proxy_password command-line options.

    Using LWP::Simple always produces the error message:

    501 Protocol scheme '' is not supported

    I've looked through the LWP documentation, but I don't see how to set the
    proxy user/password :-((

    Thanks!

    Dan
     
    Dan Rawson, Oct 15, 2007
    #1
    1. Advertising

  2. Dan Rawson <> wrote:

    > We have a proxy server which requires a user name and password. I'm
    > attempting to use LWP::Simple



    What you are trying to do goes beyond "simple", so you will need
    to use a more full-featured module instead.


    > I've looked through the LWP documentation, but I don't see how to set the
    > proxy user/password :-((



    Search for "credentials" in

    perldoc LWP::UserAgent


    --
    Tad McClellan
    email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
     
    Tad McClellan, Oct 19, 2007
    #2
    1. Advertising

  3. Dan Rawson

    Paul Lalli Guest

    On Oct 19, 7:05 am, Tad McClellan <> wrote:
    > Dan Rawson <> wrote:
    > > We have a proxy server which requires a user name and password. I'm
    > > attempting to use LWP::Simple

    >
    > What you are trying to do goes beyond "simple", so you will need
    > to use a more full-featured module instead.


    No he won't. LWP::Simple initializes its underlying User Agent by
    calling $ua->env_proxy(). LWP::UserAgent's documentation shows that
    the env_proxy() method looks for the $http_proxy environment variable.

    Just set http_proxy before loading up LWP::Simple, and you'll be fine.

    Paul Lalli
     
    Paul Lalli, Oct 19, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Woogie

    LWP with proxy problem

    Woogie, Dec 20, 2003, in forum: Perl
    Replies:
    1
    Views:
    1,043
    Roy Johnson
    Dec 22, 2003
  2. mrwoopey
    Replies:
    3
    Views:
    9,647
    mrwoopey
    Jun 30, 2003
  3. Paul East
    Replies:
    3
    Views:
    327
    Beginner
    Mar 2, 2004
  4. JD
    Replies:
    5
    Views:
    305
    Lalitha
    Oct 7, 2004
  5. Adriano Rodrigues Ferreira

    RubyGem behind an authenticating proxy

    Adriano Rodrigues Ferreira, May 4, 2004, in forum: Ruby
    Replies:
    1
    Views:
    169
    Gavin Sinclair
    May 4, 2004
Loading...

Share This Page