Open aberbegall opened 7 years ago
As alternative to tunnel-ssh I'm trying to use this module but I always get this debug output:
open-ssh-tunnel ssh tunnel is ready. +328ms open-ssh-tunnel ssh tunnel is closed. +4ms open-ssh-tunnel ssh tunnel is disconnected. + open-ssh-tunnel ssh tunnel is closed. +1ms open-ssh-tunnel port forward timed out. +1ms
This is the code I'm using in order to redirect port 5900 on 'IP remote' to a local random port and listen on another local random port.
async function openATunnel() { const server = await openSshTunnel({ username: 'myuser', privateKey: fs.readFileSync('file.ppk'), passphrase: 'mypassphrase', host: 'IP remote', dstPort: 5900, localPort: 0, port: 22, srcPort: 0 }); // THIS LINE IS NEVER REACHED!! server.close(); } openATunnel().catch(() => {});
I set the srcPort and localPort to 0 to obtain a random port.
What am I doing wrong?
openATunnel().catch(() => {});
You are ignoring any error you receive by using .catch(() => {});. Could you write the error to console and retry? .catch(err => console.log(err));
.catch(() => {});
catch(err => console.log(err));
As alternative to tunnel-ssh I'm trying to use this module but I always get this debug output:
This is the code I'm using in order to redirect port 5900 on 'IP remote' to a local random port and listen on another local random port.
I set the srcPort and localPort to 0 to obtain a random port.
What am I doing wrong?