mirror of
https://github.com/bitinflow/localtunnel.git
synced 2026-03-14 05:55:53 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3026d6a42c | ||
|
|
abd461f83a | ||
|
|
2acea3d77f | ||
|
|
5d0eb3382a |
17
bin/client
17
bin/client
@@ -3,7 +3,6 @@ var lt_client = require('../client');
|
||||
|
||||
var argv = require('optimist')
|
||||
.usage('Usage: $0 --port [num]')
|
||||
.demand(['port'])
|
||||
.options('host', {
|
||||
default: 'http://localtunnel.me',
|
||||
describe: 'upstream server providing forwarding'
|
||||
@@ -14,16 +13,30 @@ var argv = require('optimist')
|
||||
.options('local-host', {
|
||||
describe: 'tunnel traffic to this host instead of localhost'
|
||||
})
|
||||
.options('version', {
|
||||
describe: 'print version and exit'
|
||||
})
|
||||
.default('local-host', 'localhost')
|
||||
.describe('port', 'internal http server port')
|
||||
.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');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
var opt = {
|
||||
host: argv.host,
|
||||
port: argv.port,
|
||||
local_host: argv['local-host'],
|
||||
subdomain: argv.subdomain,
|
||||
}
|
||||
};
|
||||
|
||||
lt_client(opt.port, opt, function(err, tunnel) {
|
||||
if (err) {
|
||||
|
||||
@@ -312,4 +312,5 @@ module.exports = function localtunnel(port, opt, fn) {
|
||||
|
||||
fn(null, client);
|
||||
});
|
||||
return client;
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"author": "Roman Shtylman <shtylman@gmail.com>",
|
||||
"name": "localtunnel",
|
||||
"description": "expose localhost to the world",
|
||||
"version": "1.1.2",
|
||||
"version": "1.2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/shtylman/localtunnel.git"
|
||||
|
||||
Reference in New Issue
Block a user