in reply to WEBSweeper Proxy Authentication

I have no idea what you're talking about until we get into the
"But I can't think of how to emulate that in Perl ..."

It's pretty easy, you're using all the right tools, but you're missing one (not really) so check it out.

use MIME::Base64; use HTTP::Request; use LWP::UserAgent; sub IamGET { my ($url, $domain, $user, $pass) = @_; my $REQ = HTTP::Request->new(GET => $url); my $authString = encode_base64("$domain/$user:$pass"); $REQ->push_header("Proxy-Authorization", "Basic $authString"); my $UA = LWP::UserAgent->new; $UA->agent("Mozilla/6.9(${^O};retmaspod)"); my $RES = $UA->request($REQ); if($RES->is_success()) { return $RES->content; } else { $! = " Error (".scalar(localtime())."):". $RES->status_line . +"\n"; return undef; } }
update:
I'm not quite so sure that it's supposed to work. It does in fact emulate what the java code does to the best of my knowledge.

Check out this for ideas on where you stand.

LWP::UserAgent only supports basic http authentication. If you still need to use NTLM, check cpan. Since it is an HTTP protocol, you can probably find an RFC somewhere, and push whatever extra headers it reqires, which you can do using the method I demonstrated above. You might wanna also check out http://squid.sourceforge.net/ntlm/

Replies are listed 'Best First'.
Re: Re: WEBSweeper Proxy Authentication
by simon.proctor (Vicar) on Jul 17, 2002 at 11:00 UTC
    Thanks for trying but it doesn't work. Your code does not include a proxy line so I get:
    Error (Wed Jul 17 11:55:58 2002):500 Can't connect to www.yahoo.co.uk: +80 (Timeout)
    However, if I add the proxy line I then get:
    # Added $UA->proxy(['http', 'ftp'] => 'http://proxyurl'); # Error Error (Wed Jul 17 11:55:05 2002):407 Proxy authentication required
    But thanks anyway.