mirror of
https://github.com/bitinflow/localtunnel.git
synced 2026-03-14 05:55:53 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f68b1f06d9 | ||
|
|
4d09875163 | ||
|
|
2773fe6923 | ||
|
|
457bd64ecc | ||
|
|
eb31659345 | ||
|
|
3ee8b1b884 | ||
|
|
15aac729bb | ||
|
|
e73cfe3e45 |
@@ -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
|
||||
|
||||
10
bin/client
10
bin/client
@@ -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;
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user