in reply to Re^4: Questions about LWP`
in thread Questions about LWP`

Follow the trace :)

$ perl -d:Trace -S lwp-request http://example.com/ 1>1 2>2
$ grep -i sock 2
$ grep -i conn 2

# connect to remote site my $socket = $self->_new_socket($host, $port, $timeout); $self->_check_sock($request, $socket); sub _check_sock { #my($self, $req, $sock) = @_; }
So I would try overriding
*LWP::Protocol::http::Socket::connect = *LWP::Protocol::http10::Socket::connect = *LWP::Protocol::https::Socket::connect = *LWP::Protocol::https10::Socket::connect = sub { my $self = shift; my $sock = $self->SUPER::connect(@_); ## get port here return $sock; };