Code:
use WWW::Mechanize;
$bot = WWW::Mechanize->new(
onwarn => new,
onerror => undef,
autocheck => undef,
);
use MIME::Base64;
$bot->default_header(
Authorization => 'Basic ' . encode_base64( 'user' . ':' . 'pass' ) );
$bot->credentials( 'user', 'password');
$bot->proxy('http','http://user:pass@75.8.1.2:51807');
my $url = 'http://whatsmyip.net/';
my $response = $bot->get($url);
my $content = $bot->content;
print $content;
Now i've experimented with hundreads of variations of this trying to get it to work, played with putting in the realm, taking it out.. tried to get ENV{'HTTP_PROXY'} working as well - couldn't seem to get it to work.
The proxies are squid proxies and I've tried them in the connection area of the browser and they prompt for a credential style login. (which is where I figured out the realm).
I've tried everything on the first 5 pages of google for all the following keywords "perl www mechanize auth proxy" , "auth proxy perl lwp".
My code has to run in mechanize, but I also must have proxy support.