mirror of
https://github.com/bitinflow/localtunnel.git
synced 2026-03-14 05:55:53 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86cd2d3c58 | ||
|
|
d70c743014 | ||
|
|
4940043378 | ||
|
|
b4a22bff64 | ||
|
|
176ec0479d | ||
|
|
fe316de3e0 | ||
|
|
4f97434a69 | ||
|
|
a46cd02fcb | ||
|
|
792d9f19bd | ||
|
|
d0b483b92b | ||
|
|
59d96a3cc6 | ||
|
|
b516ecccfa |
10
History.md
10
History.md
@@ -1,4 +1,12 @@
|
||||
# UNRELEASED
|
||||
# 1.8.0 (2015-11-04)
|
||||
|
||||
* pass socket errors up to top level
|
||||
|
||||
# 1.7.0 (2015-07-22)
|
||||
|
||||
* add short arg options
|
||||
|
||||
# 1.6.0 (2015-05-15)
|
||||
|
||||
* keep sockets alive after connecting
|
||||
* add --open param to CLI
|
||||
|
||||
50
bin/client
50
bin/client
@@ -2,35 +2,37 @@
|
||||
var lt_client = require('../client');
|
||||
var open_url = require('openurl');
|
||||
|
||||
var argv = require('optimist')
|
||||
.usage('Usage: $0 --port [num]')
|
||||
.options('host', {
|
||||
default: 'http://localtunnel.me',
|
||||
describe: 'upstream server providing forwarding'
|
||||
var argv = require('yargs')
|
||||
.usage('Usage: $0 --port [num] <options>')
|
||||
.option('h', {
|
||||
alias: 'host',
|
||||
describe: 'Upstream server providing forwarding',
|
||||
default: 'http://localtunnel.me'
|
||||
})
|
||||
.options('subdomain', {
|
||||
describe: 'request this subdomain'
|
||||
.option('s', {
|
||||
alias: 'subdomain',
|
||||
describe: 'Request this subdomain'
|
||||
})
|
||||
.options('local-host', {
|
||||
describe: 'tunnel traffic to this host instead of localhost, override Host header to this host'
|
||||
.option('l', {
|
||||
alias: 'local-host',
|
||||
describe: 'Tunnel traffic to this host instead of localhost, override Host header to this host'
|
||||
})
|
||||
.options('version', {
|
||||
describe: 'print version and exit'
|
||||
})
|
||||
.options('open', {
|
||||
.options('o', {
|
||||
alias: 'open',
|
||||
describe: 'opens url in your browser'
|
||||
})
|
||||
.describe('port', 'internal http server port')
|
||||
.option('p', {
|
||||
alias: 'port',
|
||||
describe: 'Internal http server port',
|
||||
})
|
||||
.require('port')
|
||||
.help('help', 'Show this help and exit')
|
||||
.version(require('../package').version)
|
||||
.argv;
|
||||
|
||||
if (argv.version) {
|
||||
console.log(require('../package.json').version);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (argv.port == null) {
|
||||
require('optimist').showHelp();
|
||||
console.error('Missing required arguments: port');
|
||||
if (typeof argv.port !== 'number') {
|
||||
require('yargs').showHelp();
|
||||
console.error('port must be a number');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
@@ -47,11 +49,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;
|
||||
});
|
||||
|
||||
@@ -88,6 +88,11 @@ Tunnel.prototype._establish = function(info) {
|
||||
self.emit('url', info.url);
|
||||
});
|
||||
|
||||
// re-emit socket error
|
||||
tunnels.on('error', function(err) {
|
||||
self.emit('error', err);
|
||||
});
|
||||
|
||||
var tunnel_count = 0;
|
||||
|
||||
// track open count
|
||||
|
||||
10
package.json
10
package.json
@@ -2,16 +2,16 @@
|
||||
"author": "Roman Shtylman <shtylman@gmail.com>",
|
||||
"name": "localtunnel",
|
||||
"description": "expose localhost to the world",
|
||||
"version": "1.6.0",
|
||||
"version": "1.8.0",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/shtylman/localtunnel.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"request": "2.11.4",
|
||||
"optimist": "0.3.4",
|
||||
"debug": "0.7.4",
|
||||
"request": "2.65.0",
|
||||
"yargs": "3.29.0",
|
||||
"debug": "2.2.0",
|
||||
"openurl": "1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -24,4 +24,4 @@
|
||||
"lt": "./bin/client"
|
||||
},
|
||||
"main": "./client.js"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user