LWP::Pr...connect(3)

πŸ“¦
version 6.09 Β· 2 versions
, in fedora 43

✨ 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::SSL
  • LWP::Protocol::https

go read those too, iykyk 🌸


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