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/


In reply to Re: WEBSweeper Proxy Authentication by PodMaster
in thread WEBSweeper Proxy Authentication by simon.proctor

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.