LWP::P...:socks4(3pm)
π LWP::Protocol::socks β the manual page, but make it make sense π
okay bestie, so this is the page for LWP::Protocol::socks (yes, that truncated LWP::P...:socks4(3pm) header you saw is just the terminal being dramatic β it lives in the User Contributed Perl Documentation, section 3pm). Sit down, grab a strawberry π, and let's get into it.
β¨ NAME β¨
LWP::Protocol::socks β it adds support for the socks protocol and proxy facility. that's the whole job description, and it eats. π
π SYNOPSIS π
use LWP::Protocol::socks;
one line. iconic. no cap.
π¦ DESCRIPTION π¦
so the vibe check here is: use this package when you wish to use a socks proxy for your connections. that's the moment. that's the use case.
it provides some essential hooks into the LWP system to implement a socks "scheme" β similar to http for describing your socks connection β and it can be used to proxy either http or https connections. both. slay.
the whole plan is to use LWP::UserAgent's proxy method to register your socks proxy, like so:
$ua->proxy([qw(http https)] => 'socks://socks.yahoo.com:1080');
and then? just use your $ua object as usual! that's it. that's the tea. π«Ά
π₯ EXAMPLES π₯
here's the full little script, copy-paste ready, no thoughts just vibes:
#!/usr/local/bin/perl
use strict;
use LWP::UserAgent;
my $ua = new LWP::UserAgent(agent => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.5) Gecko/20060719 Firefox/1.5.0.5');
$ua->proxy([qw(http https)] => 'socks://socks.yahoo.com:1080');
my $response = $ua->get("http://www.freebsd.org");
print $response->code,' ', $response->message,"\n";
my $response = $ua->get("https://www.microsoft.com");
print $response->code,' ', $response->message,"\n";
not me noticing it declares my $response twice in the same scope π that's between you and use strict, bestie, I'm just reporting the facts.
π SEE ALSO π
URI::socks4LWP::Protocol::socks
(yes it references itself, main character energy fr fr π)
πΈ AUTHORS πΈ
Oleg G <oleg@cpan.org> β thank you for your service, king π
and that's the whole page, bestie! this was documented in the User Contributed Perl Documentation, running under perl v5.34.0, dated 2022-06-15 β and remember, LWP::P...:socks4(3pm) was just the name getting squished by your terminal width. go proxy something. periodt. πβ¨
π¦ where this page comes from
- debian bookworm: liblwp-protocol-socks-perl 1.7-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: liblwp-protocol-socks-perl 1.7-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: liblwp-protocol-socks-perl 1.7-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: liblwp-protocol-socks-perl 1.7-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: liblwp-protocol-socks-perl 1.7-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms