How to use localtunnel - 9 common examples

To help you get started, we’ve selected a few localtunnel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github localtunnel / server / test / basic.js View on Github external
before('set up localtunnel client', function(done) {
    var opt = {
        host: 'http://localhost:' + lt_server_port,
    };

    localtunnel(test._fake_port, opt, function(err, tunnel) {
        assert.ifError(err);
        var url = tunnel.url;
        assert.ok(new RegExp('^http:\/\/.*localhost:' + lt_server_port + '$').test(url));
        test._fake_url = url;
        done(err);
    });
});
github localtunnel / server / test / queue.js View on Github external
before('set up localtunnel client', function(done) {
    var opt = {
        host: 'http://localhost:' + lt_server_port,
    };

    localtunnel(test._fake_port, opt, function(err, tunnel) {
        assert.ifError(err);
        var url = tunnel.url;
        assert.ok(new RegExp('^http:\/\/.*localhost:' + lt_server_port + '$').test(url));
        test._fake_url = url;
        done(err);
    });
});
github localtunnel / server / test / simple.js View on Github external
test('set up localtunnel client', function(done) {
    var opt = {
        host: 'http://localhost:' + lt_server_port,
    };

    localtunnel(test._fake_port, opt, function(err, tunnel) {
        assert.ifError(err);
        var url = tunnel.url;
        assert.ok(new RegExp('^http:\/\/.*localhost:' + lt_server_port + '$').test(url));
        test._fake_url = url;
        done(err);
    });
});
github localtunnel / server / test / websocket.js View on Github external
before('set up localtunnel client', function(done) {
    var opt = {
        host: 'http://localhost:' + lt_server_port,
    };

    localtunnel(test._fake_port, opt, function(err, tunnel) {
        assert.ifError(err);
        var url = tunnel.url;
        assert.ok(new RegExp('^http:\/\/.*localhost:' + lt_server_port + '$').test(url));
        test._fake_url = url;
        done(err);
    });
});
github micnews / condor / test / saucelabs-child.js View on Github external
test('setup browser, server & tunnel', function* () {
  yield server.listen.bind(server, 0)
  tunnel = yield localtunnel.bind(localtunnel, server.address().port)

  tunnel.tunnel_cluster.on('error', function (err) {
    if (!err.code || err.code !== 'ETIMEDOUT') {
      throw err
    }
  })

  server.url = tunnel.url
  yield browser.init(config)
})
github matthewmueller / component-test / lib / tunnel.js View on Github external
function tunnel(port, fn) {
  var client = localtunnel.connect({
    host: 'http://localtunnel.me',
    port: port
  });

  client.on('url', function(url) {
    fn(null, url);
  });

  return client;
}
github plinko-team / plinko / src / server / tunnel.js View on Github external
function startLocalTunnel() {
  const tunnel = localtunnel(3000, {subdomain: 'radioactive-kittens'}, (err, tunnel) => {
    console.log(tunnel.url);
  })

  tunnel.on('close', function() {
    console.log('tunnel closed :(');
  });
}
github mathdroid / node-line-messaging-api / src / webhook.js View on Github external
return new Promise((resolve, reject) => {
      const tunnel = localtunnel(port, (err, {url}) => {
        if (err) {
          reject({err})
        }
        resolve({url})
      })
      this.tunnel = tunnel
    })
  }
github airtap / airtap / lib / tunnel.js View on Github external
module.exports = function(port, cb) {
    debug('tunnel requested to port %d', port);

    var client = localtunnel.connect({
        host: 'http://localtunnel.me',
        port: port
    });

    client.on('url', function(url) {
        cb(null, url);
    });

    return client;
};

localtunnel

Expose localhost to the world

MIT
Latest version published 3 years ago

Package Health Score

65 / 100
Full package analysis