sanketbajoria / ssh2-promise

ssh with promise/async await and typescript support
https://www.npmjs.com/package/ssh2-promise
MIT License
148 stars 24 forks source link

closeTunnel has high latency #67

Open blogwy opened 2 years ago

blogwy commented 2 years ago

After I run closeTunnel, the tunnel website can still be accessed. Then it took 2 minutes for the tunnel to be completely closed

const SSH2Promise = require('ssh2-promise')

const sshconfig = { host: 'xxxxx', username: 'xxxx', password: 'xxxx', port: 'xxxx' }

const tunnelConfig = { name: 'hahaha', remoteAddr: 'localhost', remotePort: '80' }

var ssh = new SSH2Promise(sshconfig);

ssh.addTunnel(tunnelConfig).then((tunnel) => { console.log(tunnel.localPort); });

ssh.closeTunnel('hahaha') .then(res => { console.log('24') console.log(res) }) .catch(err => { console.log('28') console.log(err) })