in reply to Proxy authentication using NTLM?
Update: I couldn't get it to work correctly without setting $ua->env_proxy. Edited script to reflect that.#!/usr/local/bin/perl use strict; use warnings; use LWP::UserAgent::Determined; use HTTP::Request::Common; use Authen::NTLM; ntlmv2(1); my $url = 'http://www.bbc.co.uk/'; my $ua = LWP::UserAgent::Determined->new(keep_alive=>1); $ua->credentials('www.bbc.co.uk:80', '', 'mydomain\\myuser', 'mypass') +; my $request = GET $url; print "--Performing request now...-----------\n"; my $response = $ua->request($request); print "--Done with request-------------------\n"; if ($response->is_success) {print "It worked!->" . $response->code . " +\n"} else {print "It didn't work!->" . $response->code . "\n"} my $contents = $response->content(); print $response->status_line(), "\n"; print $response->headers()->as_string(), "\n";
|
|---|