Net::P...r::dual(3pm)
β¨ Net::Proxy::Connector::dual β¨
okay so bestie, gather round, because this one is genuinely iconic π
β we're talking about Net::Proxy::Connector::dual from the Net::Proxy family, and yes, the manual name up top is Net::P...r::dual(3pm) because terminal headers are dramatic and love to truncate. Anyway. Let's get into it π«Ά
π NAME π
Net::Proxy::Connector::dual β a Y-shaped Net::Proxy connector. Y-shaped!! it's giving tree diagram, it's giving fork in the road, it's giving choose your own adventure πΈ
π¦ DESCRIPTION π¦
Net::Proxy::Connecter::dual (and yes, that's literally how it's spelled in the docs, no I am not fixing it, we respect the lore π) is a Net::Proxy::Connector that can forward the connection to two distinct services, based on the client connection, before any data is exchanged. no cap.
Like. it decides which way you're going before anyone says a single word. main character energy fr fr β¨
π CONNECTOR OPTIONS π
Real talk first: this connector can only work as an "in" connector. it's an inbound girly. it does not do outbound. periodt.
The server_first and client_first options are required β like, mandatory mandatory, no skipping. they are hashrefs containing the options necessary to create two "out" Net::Proxy::Connector objects that will be used to connect to the requested service.
The Net::Proxy::Connector::dual object decides between the two services by waiting during a short timeout:
- if the client sends some data directly β it gets connected via the
client_firstconnector πΈ - otherwise, at the end of the timeout β it gets connected via the
server_firstconnector π¦
so it's literally a vibe check with a clock on it. whoever speaks first (or doesn't) decides everything π
hostβ the hostname on which the connector will listen for client connections. default islocalhostπportβ the port on which the connector will listen for client connections. (the doorway bestie, the little portal π)server_firstβ typically an"out"connector to a SSH server or any service that sends a banner line. it talks first, that's its whole thing πclient_firstβ typically an"out"connectrot to a web server or SSL server. (yes it says "connectrot" in the docs, and honestly? iconic typo, we stan πΈ)timeoutβ the timeout in seconds (can be decimal) to make a decision. default is1second β³
ngl the decimal thing is lowkey important β 0.5 is a whole valid mood here.
π AUTHOR π
Philippe 'BooK' Bruhat, <book@cpan.org>. π«Ά
π ACKNOWLEDGMENTS π
This module is based on a script named sslh, which I wrote with FrΓ©dΓ©ric PlΓ© <frederic.ple+sslh@gmail.com> β and credit where it's due, he had the original insight about the fact that not all servers speak first on the wire. that's the whole seed of this entire thing, and it's genius honestly π§
FrΓ©dΓ©ric wrote a C program, while I wrote a Perl script (based on my experience with connect-tunnel).
Now that Net::Proxy is available, I've ported the Perl script to use it. glow up complete β¨
π COPYRIGHT π
Copyright 2006-2014 Philippe 'BooK' Bruhat, All Rights Reserved. π
π LICENSE π
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay π
and that's the whole page bestie!! this was Net::P...r::dual(3pm) β perl v5.38.2, dated 2024-05-15, straight from User Contributed Perl Documentation. mwah π go forth and dual-connect responsibly π¦π
π¦ where this page comes from
- debian trixie: libnet-proxy-perl 0.13-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libnet-proxy-perl 0.13-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libnet-proxy-perl 0.13-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