LWP problems

Discussion in 'Perl Misc' started by Mike, Jul 11, 2005.

  1. Mike

    Mike Guest

    I'm trying to touch IBM from inside a proxy. My LWP code touches the proxy,
    but does not authenticate with the proxy so I can go on to IBM. Does anyone
    see my mistake?

    Thanks

    Mike

    Here is the code:


    #!/usr/bin/perl

    # $Id$
    # $Log$

    # grab the machine type from 'lsattr -El sys0'
    # grab the current microcode version depending on the command for that machine
    # grab the latest microcode version for this box from:
    # http://techsupport.services.ibm.com/server/mdownload/download.html
    # complain if the microcode is not at the current version

    use LWP::UserAgent;
    use LWP::Debug qw(+);
    use strict;

    # globals
    my $microcodeurl = 'http://techsupport.services.ibm.com/server/mdownload/download.html';

    # get the machine type
    my $cmd = 'lsattr -El sys0 | grep modelname';
    open(IN, "$cmd |") or die "$0: cannot execute '$cmd': $!";
    my $line = <IN>;
    close(IN);
    chomp($line);

    # pull the microcode version from IBM
    # and the command to get the currently installed microcode version
    my $ua = LWP::UserAgent->new();
    $ua->proxy('http', 'http://txisa002.ttiinc.com:8080');
    my $req = HTTP::Request->new(GET => $microcodeurl);
    my $user = 'domain\user';
    my $pass = 'password';
    $req->proxy_authorization_basic($user, $pass);
    my $page = $ua->request($req)->as_string;
    1;
    Mike, Jul 11, 2005
    #1
    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. cp
    Replies:
    3
    Views:
    6,046
  2. Tommy
    Replies:
    0
    Views:
    1,038
    Tommy
    Sep 22, 2003
  3. Ronny Mandal

    LWP-problems

    Ronny Mandal, Dec 13, 2005, in forum: Perl Misc
    Replies:
    5
    Views:
    111
    Ronny Mandal
    Dec 13, 2005
  4. stephenc

    problems with LWP & HTTP

    stephenc, Aug 14, 2007, in forum: Perl Misc
    Replies:
    4
    Views:
    127
    stephenc
    Aug 28, 2007
  5. Dan Rawson

    LWP problems with authenticating proxy

    Dan Rawson, Oct 15, 2007, in forum: Perl Misc
    Replies:
    2
    Views:
    225
    Paul Lalli
    Oct 19, 2007
Loading...

Share This Page