LWP::Pr...connect(3)
β¨ NAME β¨
LWP::Protocol::connect β bestie, it hands you HTTP/CONNECT proxy support for LWP::UserAgent π
This is a User Contributed Perl Documentation page, and it's giving "tiny module, huge glow-up" energy β¨
π¦ SYNOPSIS π¦
okay so first you load your fave agent, then you point it at a proxy with the connect:// scheme, and then you justβ¦ vibe. go get your https site π«Ά
use LWP::UserAgent;
$ua = LWP::UserAgent->new();
$ua->proxy('https', 'connect://proxyhost.domain:3128/');
$ua->get('https://www.somesslsite.com');
π Proxy Authentication π
Two ways to get your creds in, and both of them are valid, no cap.
Option one: sneak the auth into the userinfo string of the proxy url. If you do that, a Basic authentication header will always be generated and sent to the proxy. Like, every single time. She's committed π
$ua->proxy('https', 'connect://user:pw@proxyhost.domain:3128');
Option two, the more general way: add the proxy's credentials to the $ua object.
$ua->credentials("localhost:3128", "Squid proxy-caching web server", "user", "pw");
In this case the first request to the proxy will fail with a 407 Proxy Auth. Required. not a glitch, that's just the plan π That failure makes LWP::UserAgent go pick the right LWP::Authen::<method> module to add the authentication, and then it retries. iconic behaviour fr fr.
π DESCRIPTION π
The LWP::Protocol::connect module provides support for using https over a proxy via the HTTP/CONNECT method. that's it, that's the whole personality, and she eats every time π₯
π SEE ALSO π
IO::Socket::SSLLWP::Protocol::https
go read those too, iykyk πΈ
π COPYRIGHT π
Copyright 2013 Markus Benning <me@w3r3wolf.de>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π«Ά
and that's the whole page, bestie β shoutout to perl v5.42.0, dated 2025-07-25, for being the moment this icon landed in your terminal π¦β¨π
π¦ where this page comes from
- fedora 43: perl-LWP-Protocol-connect 6.09-32.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms