mirror of
https://github.com/bitinflow/localtunnel.git
synced 2026-03-15 14:35:54 +00:00
Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8efcb3a294 | ||
|
|
b9c1901d60 | ||
|
|
edc182125f | ||
|
|
81c28d4d68 | ||
|
|
9a1d48764a | ||
|
|
371db2870a | ||
|
|
4ae493ae44 | ||
|
|
f487effe3a | ||
|
|
333af2b08f | ||
|
|
b32041d8aa | ||
|
|
649de1b840 | ||
|
|
f791217756 | ||
|
|
cce9d1490a | ||
|
|
86cd2d3c58 | ||
|
|
d70c743014 | ||
|
|
4940043378 | ||
|
|
b4a22bff64 | ||
|
|
176ec0479d | ||
|
|
fe316de3e0 | ||
|
|
4f97434a69 | ||
|
|
a46cd02fcb | ||
|
|
792d9f19bd | ||
|
|
d0b483b92b | ||
|
|
59d96a3cc6 | ||
|
|
b516ecccfa |
@@ -1,3 +1,4 @@
|
|||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- "0.10"
|
- "4"
|
||||||
|
- "6"
|
||||||
|
|||||||
19
History.md
19
History.md
@@ -1,4 +1,21 @@
|
|||||||
# UNRELEASED
|
# 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
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
# localtunnel [](https://travis-ci.org/defunctzombie/localtunnel) #
|
# localtunnel
|
||||||
|
|
||||||
|
[](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
|
||||||
|
|||||||
46
bin/client
46
bin/client
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
10
package.json
10
package.json
@@ -2,16 +2,16 @@
|
|||||||
"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.2",
|
||||||
"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.78.0",
|
||||||
"optimist": "0.3.4",
|
"yargs": "3.29.0",
|
||||||
"debug": "0.7.4",
|
"debug": "2.2.0",
|
||||||
"openurl": "1.1.0"
|
"openurl": "1.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
Reference in New Issue
Block a user