How can I set a timeout for the connection to a ssh server?
Currently, I am connecting to the server with the following code:
var Client = require('ssh2');
var conn = new Client();
conn.on('ready', function(){
console.log("connected");
});
conn.on('error', function(){
console.log("fails");
});
conn.connect({
host: ip,
port: 22,
username: user,
password: password
});