8 Commits

Author SHA1 Message Date
Roman Shtylman
f68b1f06d9 1.6.0 2015-07-15 22:29:49 -07:00
Roman Shtylman
4d09875163 update history 2015-07-15 22:26:40 -07:00
Roman Shtylman
2773fe6923 Merge pull request #74 from davej/patch-1
Increase max event listeners to prevent premature memory-leak warnings
2015-07-15 22:24:47 -07:00
Roman Shtylman
457bd64ecc Merge pull request #85 from zeevl/keep-alive
Keep sockets alive after connecting
2015-07-15 15:19:35 -07:00
Steve Lamb
eb31659345 Keep sockets alive after connecting 2015-07-15 10:29:53 -07:00
Roman Shtylman
3ee8b1b884 Merge pull request #79 from Urucas/master
Add --open param to open tunnel url
2015-06-23 23:29:39 -07:00
vrunoa
15aac729bb add open param; opens url in your browser after localtunnel is launched
add open param; opens url in your browser after localtunnel is launched

update package version

multiplatform open with openurl package

update package.json

correct source code spacing & indentation

update openurl dependency

revert package version

move require('openurl') to the top, correct 4 spaces indentation
2015-06-23 17:10:28 -03:00
Dave Jeffery
e73cfe3e45 Increase max event listeners to prevent premature memory-leak warnings #71 2015-05-31 22:19:45 +01:00
5 changed files with 23 additions and 3 deletions

View File

@@ -1,3 +1,8 @@
# UNRELEASED
* keep sockets alive after connecting
* add --open param to CLI
# 1.5.0 (2014-10-25)
* capture all errors on remote socket and restart the tunnel

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env node
var lt_client = require('../client');
var open_url = require('openurl');
var argv = require('optimist')
.usage('Usage: $0 --port [num]')
@@ -16,6 +17,9 @@ var argv = require('optimist')
.options('version', {
describe: 'print version and exit'
})
.options('open', {
describe: 'opens url in your browser'
})
.describe('port', 'internal http server port')
.argv;
@@ -43,7 +47,11 @@ lt_client(opt.port, opt, function(err, tunnel) {
}
console.log('your url is: %s', tunnel.url);
if (argv.open) {
open_url.open(tunnel.url);
}
tunnel.on('error', function(err) {
throw err;
});

View File

@@ -73,6 +73,10 @@ Tunnel.prototype._init = function(cb) {
Tunnel.prototype._establish = function(info) {
var self = this;
var opt = self._opt;
// increase max event listeners so that localtunnel consumers don't get
// warning messages as soon as they setup even one listener. See #71
self.setMaxListeners(info.max_conn + (EventEmitter.defaultMaxListeners || 10));
info.local_host = opt.local_host;
info.local_port = opt.port;

View File

@@ -38,6 +38,8 @@ TunnelCluster.prototype.open = function() {
port: remote_port
});
remote.setKeepAlive(true);
remote.on('error', function(err) {
// emit connection refused errors immediately, because they
// indicate that the tunnel can't be established.

View File

@@ -2,7 +2,7 @@
"author": "Roman Shtylman <shtylman@gmail.com>",
"name": "localtunnel",
"description": "expose localhost to the world",
"version": "1.5.1",
"version": "1.6.0",
"license": "MIT",
"repository": {
"type": "git",
@@ -11,7 +11,8 @@
"dependencies": {
"request": "2.11.4",
"optimist": "0.3.4",
"debug": "0.7.4"
"debug": "0.7.4",
"openurl": "1.1.0"
},
"devDependencies": {
"mocha": "~1.17.0"