I have been looking at using the ssh2 module for sftp shipping of logs. However the cloud service hosting our app uses a rotating ip address range. So wanting to integrate the socks5 proxy service that is giving us the static ip address. I'm using the socksjs module to get the socks5 connection established, I'm getting the connection to the proxy, but I think I have the injecting of that socket connection for the sftp to use wrong.
Cheers,
Nik
var sockConn = new SocksConnection(connTargetSettings, connProxySettings);
connTargetSettings.sock = sockConn.outSocket;
var conn = new ssh2.Client();
conn.on("ready", function() {
conn.sftp(function(err, sftp) {
if (err) throw err;
// you'll be able to use sftp here
sftp.readdir("/", function(err, list) {
if (err) throw err;
// List the directory in the console
console.dir(list);
// Do not forget to close the connection, otherwise you'll get troubles
conn.end();
});
// Use sftp to execute tasks like .unlink or chmod etc
});
}).connect(connTargetSettings);
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)