createTunnel () { logger.info('cordova-paramedic: attempt to create local tunnel'); return Q.Promise((resolve, reject) => { const tunnel = localtunnel(this.port, (err, tunnel) => { if (err) { reject('Unable to create local tunnel: ' + err); return; } this.tunneledUrl = tunnel.url; logger.info('cordova-paramedic: using tunneled url ' + this.tunneledUrl); resolve(this); }); // this trace is useful to debug test run timeout issue tunnel.on('close', function () { logger.normal('local-server: local tunnel has been closed'); }); }); }
localtunnel(port, { subdomain: config.get('subdomain') }, (err, tunnel) => { if (err) throw err; console.log(`Zeeka is live on ${tunnel.url}`); opn(tunnel.url); tunnel.on('close', () => { console.log('File Sharing Stopped'); });