Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise(function(resolve, reject) {
var tunnelPort = Math.round(Math.random()*10000);
var config = {
host: ssh_host,
srcPort: tunnelPort,
dstPort: ssh_port,
username: ssh_username,
password: ssh_password
};
var server = tunnel(config)
.then(function (result) {
resolve(_this.getDirectConnection(mysql_host, tunnelPort, mysql_user, mysql_password, mysql_database));
})
.catch(function (err) {
reject(err);
})
});
},