From fbfc923a7e9e2fe7fc56eb3580a2ef92ad292e11 Mon Sep 17 00:00:00 2001 From: Roman Shtylman Date: Thu, 13 Feb 2014 23:51:29 -0500 Subject: [PATCH] remove `connect` export in favor of single function Since connect was the only function exported, we can just export the function directly to make things simpler. --- README.md | 8 +++++--- client.js | 2 +- test/index.js | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c7d7f4b..fb05869 100644 --- a/README.md +++ b/README.md @@ -31,9 +31,11 @@ The localtunnel client is also usable through an API (for test integration, auto ```javascript var localtunnel = require('localtunnel'); -var client = localtunnel.connect({ - // the localtunnel server - host: 'http://localtunnel.me', +var client = localtunnel({ + // the localtunnel server to proxy through + // default is localtunnel.me + //host: 'http://localtunnel.me', + // your local application port port: 12345 }); diff --git a/client.js b/client.js index 69a7bcc..991dba3 100644 --- a/client.js +++ b/client.js @@ -242,7 +242,7 @@ Tunnel.prototype.close = function() { self.emit('close'); }; -module.exports.connect = function(opt) { +module.exports = function localtunnel(opt) { var client = Tunnel(opt); client.open(); return client; diff --git a/test/index.js b/test/index.js index cc36dbe..87bec19 100644 --- a/test/index.js +++ b/test/index.js @@ -21,7 +21,7 @@ test('setup local http server', function(done) { }); test('setup localtunnel client', function(done) { - var client = localtunnel.connect({ + var client = localtunnel({ port: test._fake_port }); @@ -67,7 +67,7 @@ test('query localtunnel server w/ ident', function(done) { }); test('request specific domain', function(done) { - var client = localtunnel.connect({ + var client = localtunnel({ port: test._fake_port, subdomain: 'abcd' });