I've been running a news fetcher at work sucessfully for some time, until WEBSweeper was installed. The problem now is that the standard method of authenticating (as shown in the LWP cookbook doesn't work. For example:
my $ua = LWP::UserAgent->new; # Proxy location $ua->proxy(['http', 'ftp'] => 'proxy-url'); # What we want - hardcoded my $req = HTTP::Request->new('GET',"target-url"); # Authenticate against the proxy - hardcoded $req->proxy_authorization_basic("domain/user", "password");

Sadly I now get a 407 and, before you ask, the domain, username and password are upto date :). In fact this worked without a hitch on MSProxy v2.0. Now I've done some searching and NTLM authentication appears (at a glance) to be what I need to do but frankly I have NO IDEA what that is or how to do it.

Even more frustrating is that the following Java code never broke:
URL url = new URL("target"); String authString = "domain/user:password"; String auth = "Basic " + new sun.misc.BASE64Encoder().encode(authStrin +g.getBytes()); URLConnection conn = url.openConnection(); conn.setRequestProperty("Proxy-Authorization", auth);
But I can't think of how to emulate that in Perl, or even if I should. I've also tried the other authentication methods that I could find (as well as mucking about with the headers) but that was just a case of shotgun debugging that I shouldn't really admit to :)

Can anyone help?

In reply to 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.