Subject: | Net::SSH::Perl::WithSocks |
Date: | Thu, 15 May 2014 14:14:51 -0700 |
To: | bug-Net-SSH-Perl-WithSocks [...] rt.cpan.org |
From: | Ben Janusch <bjanusch [...] gmail.com> |
Hi,
I recently had a need to do ssh over socks via perl and your library was
the closest thing to a start I could find. I did have to change a few
things to make it work.
1. The instructions and the code don't appear to line up. The
instructions say to add with_socks => { socks_host => 'host', socks_port =>
9000} to the SSH new call, but those switches aren't what the code is
looking for. The code is looking for SocksHost and SocksPort.
2. Method inet_aton is not found. I suspect the code isn't using the
package it belongs to. I took it out. That makes the $ssh->{host}
possibly supply bad addresses, but it works.
3. The code was never setting up the IO::Socket::Socks socket because
$self->{WithSocks} is never being set in _init. In _init, if (
$params{SocksHost}) needs to be if ( $params{with_socks}{SocksHost} ). The
$param calls to set ProxyAddr and ProxyPort also need to use the top level
hash {with_socks} to have the params set.
4. Not a bug, but adding authentication to this module was pretty simple
after adding Username, Password, and AuthType switches to the _init
section. They get passed to IO::Socket::Socks using the existing _connect
code and will authenticate to a SOCKS5 proxy nicely.