I'm just beginning my journey at the monastery, although I've been programming in perl for a few years now. Recently, I've decided to try and enhance an existing perl module Re^2: Using SSH via SOCKS5 Proxy, and salva made a good design suggestion Re^3: Using SSH via SOCKS5 Proxy.
I could simply hack the Net::SSH::Perl module to use Net::SOCKS when requested, but salva suggests to make it more general. I take this to mean that a user should be able to specify a given module to use (something like $ssh->proxy(Net::SOCKS, $ip, $port).
Obviously, this means there has to be some way to "plug" the SOCKS module into the SSH module (like tinker-toys). What is the best way to do this?
Am I even on the right track?
Maybe it just makes more sense to do something like:
for setting up the proxy, and then just have SSH send/receive everything through the $sock, once it's setup.ssh->proxy( sub{ require Net::SOCKS; my $sock = new Net::SOCKS (...); ... return($sock); });
How have others solved this type of problem? My goal is to provide the module author with a viable solution for consideration in making it official. Any direction is much appreciated!
Thanks
-Craig
In reply to Module Tinker-Toy-ification by cmv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |