Jwt #142
@@ -31,9 +31,11 @@ The localtunnel client is also usable through an API (for test integration, auto
|
|||||||
```javascript
|
```javascript
|
||||||
var localtunnel = require('localtunnel');
|
var localtunnel = require('localtunnel');
|
||||||
|
|
||||||
var client = localtunnel.connect({
|
var client = localtunnel({
|
||||||
// the localtunnel server
|
// the localtunnel server to proxy through
|
||||||
host: 'http://localtunnel.me',
|
// default is localtunnel.me
|
||||||
|
//host: 'http://localtunnel.me',
|
||||||
|
|
||||||
// your local application port
|
// your local application port
|
||||||
port: 12345
|
port: 12345
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ Tunnel.prototype.close = function() {
|
|||||||
self.emit('close');
|
self.emit('close');
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.connect = function(opt) {
|
module.exports = function localtunnel(opt) {
|
||||||
var client = Tunnel(opt);
|
var client = Tunnel(opt);
|
||||||
client.open();
|
client.open();
|
||||||
return client;
|
return client;
|
||||||
|
|||||||
+2
-2
@@ -21,7 +21,7 @@ test('setup local http server', function(done) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('setup localtunnel client', function(done) {
|
test('setup localtunnel client', function(done) {
|
||||||
var client = localtunnel.connect({
|
var client = localtunnel({
|
||||||
port: test._fake_port
|
port: test._fake_port
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ test('query localtunnel server w/ ident', function(done) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('request specific domain', function(done) {
|
test('request specific domain', function(done) {
|
||||||
var client = localtunnel.connect({
|
var client = localtunnel({
|
||||||
port: test._fake_port,
|
port: test._fake_port,
|
||||||
subdomain: 'abcd'
|
subdomain: 'abcd'
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user