Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function recreateTunnel(localPort) {
ngrok.disconnect() // disconnect all ngrok service on this computer
const ngrokURL = await createTunnel(localPort)
return ngrokURL
}
function cleanUp() {
ngrok.disconnect();
ngrok.kill();
server.close(() => {
console.log('Shut down server.');
});
}
.end(function (err, res) {
if (err) return t.fail(err)
t.equal(res.text, 'Hello World\n', 'should respond to https request')
ngrok.disconnect(url)
server.close()
hostile.remove('127.0.0.1', host)
})
})
nc.on('data', (info, msg) => {
if (msg.toString('utf8').includes("ciderdone")) {
cbcount++;
if (cbcount >= raw_targets.length) {
log(chalk.green("Basic recon scan complete."));
duplex.unpipe(process.stdout);
nc.close();
ngrok.disconnect(ng_url);
return callback();
}
}
});
});
}
this.props.setURL(url);
log.info(url);
this.props.setWorldPublic(true);
this.setState({
msg: 'You are now sharing with the world!',
lastClient: '',
logs: {
top: '2.3em',
borderBottom: '2px solid #186926'
}
});
});
} else if (this.props.serverStatus === 'RUNNING' && this.props.worldPublic) {
this.props.setURL(`http://${this.props.ip}:${this.props.port}`);
ngrok.disconnect();
ngrok.kill();
this.props.setWorldPublic(false);
this.setState({
msg: 'Just sharing locally!',
lastClient: '',
logs: {
top: '2.3em',
borderBottom: '2px solid #186926'
}
});
} else {
this.setState({
msg: 'Click Start and then share with the world',
lastClient: '',
logs: {
top: '2.3em',
nc.on('data', (info, msg) => {
if (msg.toString('utf8').includes("ciderdone")) {
cbcount++;
if (cbcount >= ci_targets.length) {
log(chalk.green("Nmap Scan Complete"));
duplex.unpipe(process.stdout);
nc.close();
ngrok.disconnect(ng_url);
return callback();
}
}
});
});
nc.on('data', (info, msg) => {
if (msg.toString('utf8').includes("ciderdone")) {
cbcount++;
if (cbcount >= ci_targets.length) {
log(chalk.green("Nmap Scan Complete"));
duplex.unpipe(process.stdout);
nc.close();
ngrok.disconnect(ng_url);
return callback();
}
}
});
});
nc.on('data', (info, msg) => {
if (msg.toString('utf8').includes("ciderdone")) {
cbcount++;
if (cbcount >= ci_targets.length) {
log(chalk.green("Nmap Scan Complete"));
duplex.unpipe(process.stdout);
nc.close();
ngrok.disconnect(ng_url);
return callback();
}
}
});
});
nc.on('data', (info, msg) => {
if (msg.toString('utf8').includes("ciderdone")) {
cbcount++;
if (cbcount >= raw_targets.length) {
log(chalk.green("Basic recon scan complete."));
duplex.unpipe(process.stdout);
nc.close();
ngrok.disconnect(ng_url);
return callback();
}
}
});
});
nc.on('data', (info, msg) => {
if (msg.toString('utf8').includes("ciderdone")) {
cbcount++;
if (cbcount >= ci_targets.length) {
log(chalk.green("Basic recon scan complete."));
duplex.unpipe(process.stdout);
nc.close();
ngrok.disconnect(ng_url);
return callback();
}
}
});
});