Net::P...r::dual(3pm)

πŸ“¦
version 0.13 Β· 3 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

✨ 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_first connector 🌸
  • otherwise, at the end of the timeout β†’ it gets connected via the server_first connector πŸ¦‹

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 is localhost πŸ’–
  • 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 is 1 second ⏳
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 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