#!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; my $url = $ARGV[0]; my $proxy_ip = 'https-proxy.example.com'; my $proxy_port = 80; $ENV{'HTTPS_PROXY'} = "$proxy_ip:$proxy_port"; $ENV{'HTTPS_DEBUG'} = 1; my $ua = LWP::UserAgent->new; print "Connecting to $url ...\n"; my $response = $ua->get( $url ); $response->is_success or die "Failed to GET '$url': ", $response->status_line; print $response->as_string; #### CONNECT remote.server.com:443 HTTP/1.0 HTTP/1.0 200 Connection established CONNECT https-proxy.example.com:80 HTTP/1.0 HTTP/1.0 403 Forbidden