nc -k -l localhost 9999 # on Linux, for multiple requests nc -l -p 9999 localhost # on Cygwin, for one request only #### use strict; use LWP::UserAgent; use HTTP::Request::Common; print 'LWP::UserAgent::VERSION ', $LWP::UserAgent::VERSION, "\n"; print 'IO::Socket::SSL::VERSION ', $IO::Socket::SSL::VERSION, "\n"; my $ua = LWP::UserAgent->new( timeout => 5, keep_alive => 1 ); $ua->ssl_opts( timeout => 5, Timeout => 5 ); # Yes - see note below! my $rsp = $ua->request( GET 'https://localhost:9999' ); if ( $rsp->is_success ) { print $rsp->as_string; } else { die $rsp->status_line; } #### LWP::UserAgent::VERSION 6.02 IO::Socket::SSL::VERSION 1.44 # on Linux LWP::UserAgent::VERSION 6.02 IO::Socket::SSL::VERSION 1.44 # on Win32