diff --git a/client.js b/client.js index 8545ea7..69a7bcc 100644 --- a/client.js +++ b/client.js @@ -116,7 +116,9 @@ var Tunnel = function(opt) { var self = this; self._closed = false; - self._opt = opt; + self._opt = opt || {}; + + self._opt.host = self._opt.host || 'https://localtunnel.me'; }; Tunnel.prototype.__proto__ = EventEmitter.prototype; diff --git a/test/index.js b/test/index.js index e1a3d7e..cc36dbe 100644 --- a/test/index.js +++ b/test/index.js @@ -22,7 +22,6 @@ test('setup local http server', function(done) { test('setup localtunnel client', function(done) { var client = localtunnel.connect({ - host: 'https://localtunnel.me', port: test._fake_port }); @@ -69,7 +68,6 @@ test('query localtunnel server w/ ident', function(done) { test('request specific domain', function(done) { var client = localtunnel.connect({ - host: 'https://localtunnel.me', port: test._fake_port, subdomain: 'abcd' });