If $ua->env_proxy; doesn't work, here is another example I have used in the past.
sub GetURL { ########## # # GetURL is a generic LWP sub used to GET a URL using the provided # proxy settings, upon success it returns the page content +s or UNDEF # ########## my $url = shift; my $userAgent = new LWP::UserAgent; $userAgent->timeout( 3 ); # 3 sec timeout $userAgent->proxy( 'http' , $PROXY ) if $PROXY; my $request = HTTP::Request->new( GET => "$url" ); $request->proxy_authorization_basic( $USERNAME , $PASSWORD ) if $P +ASSWORD; my $result = $userAgent->request( $request) ; if ( $result->is_success ) { return $result->content; } return undef; }
In reply to Re^2: Lwp and NTLM authentication
by bcarroll
in thread Lwp and NTLM authentication
by miniwinz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |