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((resolve, reject) => {
const conn = new Client()
const opts = Object.assign(
{
tryKeyboard: true
},
{
readyTimeout: _.get(initOptions, 'readyTimeout'),
keepaliveInterval: _.get(initOptions, 'keepaliveInterval'),
agent: process.env.SSH_AUTH_SOCK,
algorithms: alg
},
_.pick(initOptions, [
'host',
'port',
'username',
'password',
'privateKey',
constructor () {
this.client = new Client()
}
return new Promise((resolve, reject) => {
let conn1 = new Client()
conn1.on('ready', () => {
conn1.forwardOut(
'127.0.0.1',
port,
nextHostConfig.host,
nextHostConfig.port,
(err, stream) => {
if (err) {
conn1.end()
return reject(err)
}
return stream
}
)
}).connect({
...hostConfig,