29 Commits

Author SHA1 Message Date
Roman Shtylman
627cfe4783 1.8.3 2017-06-11 17:20:10 -07:00
Roman Shtylman
dbe0c16024 Update history for 1.8.3 2017-06-11 17:20:00 -07:00
Roman Shtylman
c87bbe82e7 Update History.md 2017-06-11 17:18:23 -07:00
Roman Shtylman
c71ba81972 update request, debug, and openurl dependencies 2017-06-11 17:16:30 -07:00
Roman Shtylman
8efcb3a294 v1.8.2 2016-11-17 22:31:06 -08:00
Roman Shtylman
b9c1901d60 fix host header transform to support Host and host header 2016-11-17 22:28:34 -08:00
Roman Shtylman
edc182125f update request dep to 2.78 2016-11-17 22:27:57 -08:00
Sigve Sebastian Farstad
81c28d4d68 Fix typo in README.md (#143) 2016-09-06 06:58:25 -07:00
Roman Shtylman
9a1d48764a Merge pull request #113 from CircleCode/patch-1
[README] update the link to localtunnel server
2016-03-11 07:51:05 -08:00
Matthieu Codron
371db2870a [README] update the link to localtunnel server 2016-03-11 13:08:31 +01:00
Roman Shtylman
4ae493ae44 v1.8.1 2016-01-20 13:32:02 -08:00
Roman Shtylman
f487effe3a update History 2016-01-20 13:31:46 -08:00
Roman Shtylman
333af2b08f Merge pull request #108 from joshuaxls/master
Fix bug w/ HeaderHostTransformer and binary data
2016-01-20 13:29:50 -08:00
Joshua Slayton
b32041d8aa fix unnecessary binary->string conversion 2016-01-20 13:11:40 -08:00
Roman Shtylman
649de1b840 Merge pull request #107 from TooTallNate/patch-1
README: add missing back tick
2016-01-09 07:42:54 -08:00
Nathan Rajlich
f791217756 README: add missing back tick 2016-01-08 15:58:02 -08:00
Roman Shtylman
cce9d1490a update travis to node 4 and fix travis badge 2015-11-04 20:43:17 -08:00
Roman Shtylman
86cd2d3c58 v1.8.0 2015-11-04 08:04:54 -08:00
Roman Shtylman
d70c743014 update history 2015-11-04 08:04:29 -08:00
Roman Shtylman
4940043378 Merge pull request #102 from aronwoost/patch-01
Emit socket errors, so they can be handled
2015-11-04 07:54:45 -08:00
Aron Woost
b4a22bff64 Re-emit socket error 2015-11-04 12:04:07 +01:00
Roman Shtylman
176ec0479d Merge pull request #92 from cbas/master
Bumped deps to fix upstream SPDX license issues
2015-11-03 16:13:30 -08:00
Sebastiaan Deckers
fe316de3e0 Bumped deps to fix upstream SPDX license issues 2015-11-04 08:10:18 +08:00
Roman Shtylman
4f97434a69 v1.7.0 2015-07-22 17:19:32 -07:00
Roman Shtylman
a46cd02fcb update history 2015-07-22 17:19:15 -07:00
Roman Shtylman
792d9f19bd update history 2015-07-22 17:18:45 -07:00
Roman Shtylman
d0b483b92b Merge pull request #75 from artmees/master
Implement short argv via yargs
2015-07-22 17:16:49 -07:00
Ahmed Abdel Razzak
59d96a3cc6 Update the client to include shorthand options
Providing aliases for all of the supported options
-h, --host
-s, --subdomain
-l, --local-host
-o, --open
-p, --port
--help
--version

Minor clean up in the code removing the blocks that already handled
by yargs ( version, help and required options )

Handle validating that the passed port could be validated as a number

Remove the spaces in empty lines
2015-07-23 02:05:17 +02:00
Ahmed Abdel Razzak
b516ecccfa Replace optimist with yargs 2015-07-23 00:57:01 +02:00
7 changed files with 70 additions and 37 deletions

View File

@@ -1,3 +1,4 @@
language: node_js language: node_js
node_js: node_js:
- "0.10" - "4"
- "6"

View File

@@ -1,4 +1,27 @@
# UNRELEASED # 1.8.3 (2017-06-11)
* update request dependency
* update debug dependency
* update openurl dependency
# 1.8.2 (2016-11-17)
* fix host header transform
* update request dependency
# 1.8.1 (2016-01-20)
* fix bug w/ HostHeaderTransformer and binary data
# 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 * keep sockets alive after connecting
* add --open param to CLI * add --open param to CLI

View File

@@ -1,4 +1,6 @@
# localtunnel [![Build Status](https://travis-ci.org/defunctzombie/localtunnel.png?branch=master)](https://travis-ci.org/defunctzombie/localtunnel) # # localtunnel
[![Build Status](https://travis-ci.org/localtunnel/localtunnel.svg?branch=master)](https://travis-ci.org/localtunnel/localtunnel)
localtunnel exposes your localhost to the world for easy testing and sharing! No need to mess with DNS or deploy just to have others test out your changes. localtunnel exposes your localhost to the world for easy testing and sharing! No need to mess with DNS or deploy just to have others test out your changes.
@@ -69,7 +71,7 @@ The `tunnel` instance returned to your callback emits the following events
|error|err|fires when an error happens on the tunnel| |error|err|fires when an error happens on the tunnel|
|close||fires when the tunnel has closed| |close||fires when the tunnel has closed|
The `tunnel instance has the following methods The `tunnel` instance has the following methods
|method|args|description| |method|args|description|
|----|----|----| |----|----|----|
@@ -83,7 +85,7 @@ Clients in other languages
## server ## ## server ##
See defunctzombie/localtunnel-server for details on the server that powers localtunnel. See [localtunnel/server](//github.com/localtunnel/server) for details on the server that powers localtunnel.
## License ## ## License ##
MIT MIT

View File

@@ -2,35 +2,37 @@
var lt_client = require('../client'); var lt_client = require('../client');
var open_url = require('openurl'); var open_url = require('openurl');
var argv = require('optimist') var argv = require('yargs')
.usage('Usage: $0 --port [num]') .usage('Usage: $0 --port [num] <options>')
.options('host', { .option('h', {
default: 'http://localtunnel.me', alias: 'host',
describe: 'upstream server providing forwarding' describe: 'Upstream server providing forwarding',
default: 'http://localtunnel.me'
}) })
.options('subdomain', { .option('s', {
describe: 'request this subdomain' alias: 'subdomain',
describe: 'Request this subdomain'
}) })
.options('local-host', { .option('l', {
describe: 'tunnel traffic to this host instead of localhost, override Host header to this host' alias: 'local-host',
describe: 'Tunnel traffic to this host instead of localhost, override Host header to this host'
}) })
.options('version', { .options('o', {
describe: 'print version and exit' alias: 'open',
})
.options('open', {
describe: 'opens url in your browser' 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; .argv;
if (argv.version) { if (typeof argv.port !== 'number') {
console.log(require('../package.json').version); require('yargs').showHelp();
process.exit(0); console.error('port must be a number');
}
if (argv.port == null) {
require('optimist').showHelp();
console.error('Missing required arguments: port');
process.exit(1); process.exit(1);
} }

View File

@@ -19,12 +19,12 @@ util.inherits(HeaderHostTransformer, Transform);
HeaderHostTransformer.prototype._transform = function (chunk, enc, cb) { HeaderHostTransformer.prototype._transform = function (chunk, enc, cb) {
var self = this; var self = this;
chunk = chunk.toString();
// after replacing the first instance of the Host header // after replacing the first instance of the Host header
// we just become a regular passthrough // we just become a regular passthrough
if (!self.replaced) { if (!self.replaced) {
self.push(chunk.replace(/(\r\nHost: )\S+/, function(match, $1) { chunk = chunk.toString();
self.push(chunk.replace(/(\r\n[Hh]ost: )\S+/, function(match, $1) {
self.replaced = true; self.replaced = true;
return $1 + self.host; return $1 + self.host;
})); }));

View File

@@ -88,6 +88,11 @@ Tunnel.prototype._establish = function(info) {
self.emit('url', info.url); self.emit('url', info.url);
}); });
// re-emit socket error
tunnels.on('error', function(err) {
self.emit('error', err);
});
var tunnel_count = 0; var tunnel_count = 0;
// track open count // track open count

View File

@@ -2,17 +2,17 @@
"author": "Roman Shtylman <shtylman@gmail.com>", "author": "Roman Shtylman <shtylman@gmail.com>",
"name": "localtunnel", "name": "localtunnel",
"description": "expose localhost to the world", "description": "expose localhost to the world",
"version": "1.6.0", "version": "1.8.3",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/shtylman/localtunnel.git" "url": "git://github.com/localtunnel/localtunnel.git"
}, },
"dependencies": { "dependencies": {
"request": "2.11.4", "request": "2.81.0",
"optimist": "0.3.4", "yargs": "3.29.0",
"debug": "0.7.4", "debug": "2.6.8",
"openurl": "1.1.0" "openurl": "1.1.1"
}, },
"devDependencies": { "devDependencies": {
"mocha": "~1.17.0" "mocha": "~1.17.0"