Closed timdp closed 7 years ago
Hi there the first difference i see is that you use localhost in your ssh script and 0.0.0.0. To be honest i don't know if that makes any difference.
What kind of server do you use ? Linux with ssh_config setup ?
Can not reproduce.
I have a
remotehost
withGatewayPorts yes
configured. I'm able to set up reverse tunneling to http://localhost:8000/ by runningssh remotehost -R 8888:localhost:8000
. I'm now looking to reproduce that command in Node without spawningssh
.With the code below, browsing to http://remotehost:8888/ gives me an empty response.
I also tried adding
keepAlive: true
. It didn't seem to change much.I also looked at your index.js. I tried setting
DEBUG=*
but I think you're using the debug module wrong. If I turn it intorequire('debug')('reverse-tunnel-ssh')
, I get some logging:ready
happens once as expected and then every connection logs atcp connection
.Finally, when is my callback supposed to be called? Looking at the code, it waits for the first incoming connection. Instead, I'd like to pass a continuation for when the tunnel has been set up, keep the tunnel open, and continue my script, which doesn't seem to be possible.
Could you perhaps share a typical usage example? Thanks.