mirror of
https://github.com/bitinflow/localtunnel.git
synced 2026-03-14 14:05:54 +00:00
Compare commits
82 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7330a7121 | ||
|
|
57549598f3 | ||
|
|
e9d92039bb | ||
|
|
be3dc1a4cc | ||
|
|
4d6db16235 | ||
|
|
41270db62f | ||
|
|
42ea8ecfa5 | ||
|
|
5b313bdfaa | ||
|
|
ef78c1978e | ||
|
|
d0fc61ca97 | ||
|
|
a4bf6d16e4 | ||
|
|
9a38b8de0f | ||
|
|
c524872323 | ||
|
|
2372ec22cc | ||
|
|
db22a4efe0 | ||
|
|
610484b9d7 | ||
|
|
86deca52f2 | ||
|
|
cb3441a339 | ||
|
|
32fd1fdcbd | ||
|
|
14cac6f6c8 | ||
|
|
1f33d4992d | ||
|
|
578dc9aaae | ||
|
|
4c136a265c | ||
|
|
627cfe4783 | ||
|
|
dbe0c16024 | ||
|
|
c87bbe82e7 | ||
|
|
c71ba81972 | ||
|
|
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 | ||
|
|
f68b1f06d9 | ||
|
|
4d09875163 | ||
|
|
2773fe6923 | ||
|
|
457bd64ecc | ||
|
|
eb31659345 | ||
|
|
3ee8b1b884 | ||
|
|
15aac729bb | ||
|
|
e73cfe3e45 | ||
|
|
790a642a83 | ||
|
|
e6539e1225 | ||
|
|
4c0a5dc4eb | ||
|
|
809262cf3d | ||
|
|
ddb47d2f90 | ||
|
|
a6845ec63b | ||
|
|
adecf03f41 | ||
|
|
9bdb40e97c | ||
|
|
006ce7733b | ||
|
|
624d279c26 | ||
|
|
c2b8f2b7ab | ||
|
|
4d9dcc1711 | ||
|
|
7b1fef982f | ||
|
|
b1ebef2b0b | ||
|
|
9ad43778b7 | ||
|
|
887c444543 | ||
|
|
828cb2afcb | ||
|
|
8768329fdd | ||
|
|
3026d6a42c | ||
|
|
abd461f83a | ||
|
|
2acea3d77f | ||
|
|
5d0eb3382a |
1
.npmignore
Normal file
1
.npmignore
Normal file
@@ -0,0 +1 @@
|
||||
support
|
||||
@@ -1,3 +1,6 @@
|
||||
dist: xenial
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.10"
|
||||
- "8"
|
||||
- "10"
|
||||
- "12"
|
||||
|
||||
59
History.md
59
History.md
@@ -1,3 +1,62 @@
|
||||
# 1.9.2 (2019-06-01)
|
||||
|
||||
* Update debug to 4.1.1
|
||||
* Update axios to 0.19.0
|
||||
|
||||
# 1.9.1 (2018-09-08)
|
||||
|
||||
* Update debug to 2.6.9
|
||||
|
||||
# 1.9.0 (2018-04-03)
|
||||
|
||||
* Add _request_ event to Tunnel emitter
|
||||
* Update yargs to support config via environment variables
|
||||
* Add basic request logging when --print-requests argument is used
|
||||
|
||||
# 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
|
||||
* add --open param to CLI
|
||||
|
||||
# 1.5.0 (2014-10-25)
|
||||
|
||||
* capture all errors on remote socket and restart the tunnel
|
||||
|
||||
# 1.4.0 (2014-08-31)
|
||||
|
||||
* don't emit errors for ETIMEDOUT
|
||||
|
||||
# 1.2.0 / 2014-04-28
|
||||
|
||||
* return `client` from `localtunnel` API instantiation
|
||||
|
||||
# 1.1.0 / 2014-02-24
|
||||
|
||||
* add a host header transform to change the 'Host' header in requests
|
||||
|
||||
# 1.0.0 / 2014-02-14
|
||||
|
||||
* default to localltunnel.me for host
|
||||
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Roman Shtylman
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
25
README.md
25
README.md
@@ -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.
|
||||
|
||||
@@ -31,6 +33,12 @@ Below are some common arguments. See `lt --help` for additional arguments
|
||||
* `--subdomain` request a named subdomain on the localtunnel server (default is random characters)
|
||||
* `--local-host` proxy to a hostname other than localhost
|
||||
|
||||
You may also specify arguments via env variables. E.x.
|
||||
|
||||
```
|
||||
PORT=3000 lt
|
||||
```
|
||||
|
||||
## API ##
|
||||
|
||||
The localtunnel client is also usable through an API (for test integration, automation, etc)
|
||||
@@ -42,18 +50,22 @@ Creates a new localtunnel to the specified local `port`. `fn` will be called onc
|
||||
```javascript
|
||||
var localtunnel = require('localtunnel');
|
||||
|
||||
localtunnel(port, function(err, tunnel) {
|
||||
var tunnel = localtunnel(port, function(err, tunnel) {
|
||||
if (err) ...
|
||||
|
||||
// the assigned public url for your tunnel
|
||||
// i.e. https://abcdefgjhij.localtunnel.me
|
||||
tunnel.url;
|
||||
});
|
||||
|
||||
tunnel.on('close', function() {
|
||||
// tunnels are closed
|
||||
});
|
||||
```
|
||||
|
||||
### opts
|
||||
|
||||
* `subdomain` A *string* value requesting a specific subdomain on the proxy server. **Note** You may not actually receive this name depending on availablily.
|
||||
* `subdomain` A *string* value requesting a specific subdomain on the proxy server. **Note** You may not actually receive this name depending on availability.
|
||||
* `local_host` Proxy to this hostname instead of `localhost`. This will also cause the `Host` header to be re-written to this value in proxied requests.
|
||||
|
||||
### Tunnel
|
||||
@@ -62,10 +74,11 @@ The `tunnel` instance returned to your callback emits the following events
|
||||
|
||||
|event|args|description|
|
||||
|----|----|----|
|
||||
|request|info|fires when a request is processed by the tunnel, contains _method_ and _path_ fields|
|
||||
|error|err|fires when an error happens on the tunnel|
|
||||
|close||fires when the tunnel has closed|
|
||||
|
||||
The `tunnel instance has the following methods
|
||||
The `tunnel` instance has the following methods
|
||||
|
||||
|method|args|description|
|
||||
|----|----|----|
|
||||
@@ -77,9 +90,11 @@ Clients in other languages
|
||||
|
||||
*go* [gotunnelme](https://github.com/NoahShen/gotunnelme)
|
||||
|
||||
*go* [go-localtunnel](https://github.com/localtunnel/go-localtunnel)
|
||||
|
||||
## 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 ##
|
||||
MIT
|
||||
|
||||
61
bin/client
61
bin/client
@@ -1,29 +1,54 @@
|
||||
#!/usr/bin/env node
|
||||
var lt_client = require('../client');
|
||||
var open_url = require('openurl');
|
||||
|
||||
var argv = require('optimist')
|
||||
.usage('Usage: $0 --port [num]')
|
||||
.demand(['port'])
|
||||
.options('host', {
|
||||
default: 'http://localtunnel.me',
|
||||
describe: 'upstream server providing forwarding'
|
||||
var argv = require('yargs')
|
||||
.usage('Usage: $0 --port [num] <options>')
|
||||
.env(true)
|
||||
.option('h', {
|
||||
alias: 'host',
|
||||
describe: 'Upstream server providing forwarding',
|
||||
default: 'https://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'
|
||||
.option('l', {
|
||||
alias: 'local-host',
|
||||
describe: 'Tunnel traffic to this host instead of localhost, override Host header to this host'
|
||||
})
|
||||
.default('local-host', 'localhost')
|
||||
.describe('port', 'internal http server port')
|
||||
.options('o', {
|
||||
alias: 'open',
|
||||
describe: 'opens url in your browser'
|
||||
})
|
||||
.option('p', {
|
||||
alias: 'port',
|
||||
describe: 'Internal http server port',
|
||||
})
|
||||
.option('print-requests', {
|
||||
describe: 'Print basic request info',
|
||||
})
|
||||
.require('port')
|
||||
.boolean('print-requests')
|
||||
.help('help', 'Show this help and exit')
|
||||
.version(require('../package').version)
|
||||
.argv;
|
||||
|
||||
if (typeof argv.port !== 'number') {
|
||||
require('yargs').showHelp();
|
||||
console.error('port must be a number');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
var opt = {
|
||||
host: argv.host,
|
||||
port: argv.port,
|
||||
local_host: argv['local-host'],
|
||||
subdomain: argv.subdomain,
|
||||
}
|
||||
};
|
||||
|
||||
const PrintRequests = argv['print-requests'];
|
||||
|
||||
lt_client(opt.port, opt, function(err, tunnel) {
|
||||
if (err) {
|
||||
@@ -32,9 +57,19 @@ 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;
|
||||
});
|
||||
|
||||
if (PrintRequests) {
|
||||
tunnel.on('request', function(info) {
|
||||
console.log(new Date().toString(), info.method, info.path);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// vim: ft=javascript
|
||||
|
||||
295
client.js
295
client.js
@@ -1,299 +1,7 @@
|
||||
var net = require('net');
|
||||
var url = require('url');
|
||||
var EventEmitter = require('events').EventEmitter;
|
||||
|
||||
var request = require('request');
|
||||
var debug = require('debug')('localtunnel:client');
|
||||
|
||||
var stream = require('stream');
|
||||
var util = require('util');
|
||||
|
||||
var Transform = stream.Transform;
|
||||
|
||||
var HeaderHostTransformer = function(opts) {
|
||||
if (!(this instanceof HeaderHostTransformer)) {
|
||||
return new HeaderHostTransformer(opts);
|
||||
}
|
||||
|
||||
opts = opts || {}
|
||||
Transform.call(this, opts);
|
||||
|
||||
var self = this;
|
||||
self.host = opts.host || 'localhost';
|
||||
self.replaced = false;
|
||||
}
|
||||
util.inherits(HeaderHostTransformer, Transform);
|
||||
|
||||
HeaderHostTransformer.prototype._transform = function (chunk, enc, cb) {
|
||||
var self = this;
|
||||
chunk = chunk.toString();
|
||||
|
||||
// after replacing the first instance of the Host header
|
||||
// we just become a regular passthrough
|
||||
self.push(chunk.replace(/(\r\nHost: )\S+/, function(match, $1) {
|
||||
self._transform = undefined;
|
||||
return $1 + self.host;
|
||||
}));
|
||||
cb();
|
||||
};
|
||||
|
||||
// manages groups of tunnels
|
||||
var TunnelCluster = function(opt) {
|
||||
if (!(this instanceof TunnelCluster)) {
|
||||
return new TunnelCluster(opt);
|
||||
}
|
||||
|
||||
var self = this;
|
||||
self._opt = opt;
|
||||
|
||||
EventEmitter.call(self);
|
||||
};
|
||||
|
||||
TunnelCluster.prototype.__proto__ = EventEmitter.prototype;
|
||||
|
||||
// establish a new tunnel
|
||||
TunnelCluster.prototype.open = function() {
|
||||
var self = this;
|
||||
|
||||
var opt = self._opt || {};
|
||||
|
||||
var remote_host = opt.remote_host;
|
||||
var remote_port = opt.remote_port;
|
||||
|
||||
var local_host = opt.local_host;
|
||||
var local_port = opt.local_port;
|
||||
|
||||
debug('establishing tunnel %s:%s <> %s:%s', local_host, local_port, remote_host, remote_port);
|
||||
|
||||
// connection to localtunnel server
|
||||
var remote = net.connect({
|
||||
host: remote_host,
|
||||
port: remote_port
|
||||
});
|
||||
|
||||
remote.once('error', function(err) {
|
||||
// emit connection refused errors immediately, because they
|
||||
// indicate that the tunnel can't be established.
|
||||
if (err.code === 'ECONNREFUSED') {
|
||||
self.emit('error', new Error('connection refused: ' + remote_host + ':' + remote_port + ' (check your firewall settings)'));
|
||||
}
|
||||
else {
|
||||
self.emit('error', err);
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
self.emit('dead');
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
function conn_local() {
|
||||
if (remote.destroyed) {
|
||||
debug('remote destroyed');
|
||||
self.emit('dead');
|
||||
return;
|
||||
}
|
||||
|
||||
debug('connecting locally to %s:%d', local_host, local_port);
|
||||
remote.pause();
|
||||
|
||||
// connection to local http server
|
||||
var local = net.connect({
|
||||
host: local_host,
|
||||
port: local_port
|
||||
});
|
||||
|
||||
function remote_close() {
|
||||
debug('remote close');
|
||||
self.emit('dead');
|
||||
local.end();
|
||||
};
|
||||
|
||||
remote.once('close', remote_close);
|
||||
|
||||
// TODO some languages have single threaded servers which makes opening up
|
||||
// multiple local connections impossible. We need a smarter way to scale
|
||||
// and adjust for such instances to avoid beating on the door of the server
|
||||
local.once('error', function(err) {
|
||||
debug('local error %s', err.message);
|
||||
local.end();
|
||||
|
||||
remote.removeListener('close', remote_close);
|
||||
|
||||
if (err.code !== 'ECONNREFUSED') {
|
||||
return remote.end();
|
||||
}
|
||||
|
||||
// retrying connection to local server
|
||||
setTimeout(conn_local, 1000);
|
||||
});
|
||||
|
||||
local.once('connect', function() {
|
||||
debug('connected locally');
|
||||
remote.resume();
|
||||
|
||||
var stream = remote;
|
||||
|
||||
// if user requested something other than localhost
|
||||
// then we use host header transform to replace the host header
|
||||
if (local_host !== 'localhost') {
|
||||
stream = remote.pipe(HeaderHostTransformer({ host: local_host }));
|
||||
}
|
||||
|
||||
stream.pipe(local).pipe(remote);
|
||||
|
||||
// when local closes, also get a new remote
|
||||
local.once('close', function(had_error) {
|
||||
debug('local connection closed [%s]', had_error);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// tunnel is considered open when remote connects
|
||||
remote.once('connect', function() {
|
||||
self.emit('open', remote);
|
||||
conn_local();
|
||||
});
|
||||
};
|
||||
|
||||
var Tunnel = function(opt) {
|
||||
if (!(this instanceof Tunnel)) {
|
||||
return new Tunnel(opt);
|
||||
}
|
||||
|
||||
var self = this;
|
||||
self._closed = false;
|
||||
self._opt = opt || {};
|
||||
|
||||
self._opt.host = self._opt.host || 'https://localtunnel.me';
|
||||
};
|
||||
|
||||
Tunnel.prototype.__proto__ = EventEmitter.prototype;
|
||||
|
||||
// initialize connection
|
||||
// callback with connection info
|
||||
Tunnel.prototype._init = function(cb) {
|
||||
var self = this;
|
||||
var opt = self._opt;
|
||||
|
||||
var params = {
|
||||
path: '/',
|
||||
json: true
|
||||
};
|
||||
|
||||
var base_uri = opt.host + '/';
|
||||
|
||||
// optionally override the upstream server
|
||||
var upstream = url.parse(opt.host);
|
||||
|
||||
// no subdomain at first, maybe use requested domain
|
||||
var assigned_domain = opt.subdomain;
|
||||
|
||||
// where to quest
|
||||
params.uri = base_uri + ((assigned_domain) ? assigned_domain : '?new');
|
||||
|
||||
(function get_url() {
|
||||
request(params, function(err, res, body) {
|
||||
if (err) {
|
||||
// TODO (shtylman) don't print to stdout?
|
||||
console.log('tunnel server offline: ' + err.message + ', retry 1s');
|
||||
return setTimeout(get_url, 1000);
|
||||
}
|
||||
|
||||
if (res.statusCode !== 200) {
|
||||
var err = new Error((body && body.message) || 'localtunnel server returned an error, please try again');
|
||||
return cb(err);
|
||||
}
|
||||
|
||||
var port = body.port;
|
||||
var host = upstream.hostname;
|
||||
|
||||
var max_conn = body.max_conn_count || 1;
|
||||
|
||||
cb(null, {
|
||||
remote_host: upstream.hostname,
|
||||
remote_port: body.port,
|
||||
name: body.id,
|
||||
url: body.url,
|
||||
max_conn: max_conn
|
||||
});
|
||||
});
|
||||
})();
|
||||
};
|
||||
|
||||
Tunnel.prototype._establish = function(info) {
|
||||
var self = this;
|
||||
var opt = self._opt;
|
||||
|
||||
info.local_host = opt.local_host || 'localhost';
|
||||
info.local_port = opt.port;
|
||||
|
||||
var tunnels = self.tunnel_cluster = TunnelCluster(info);
|
||||
|
||||
// only emit the url the first time
|
||||
tunnels.once('open', function() {
|
||||
self.emit('url', info.url);
|
||||
});
|
||||
|
||||
var tunnel_count = 0;
|
||||
|
||||
// track open count
|
||||
tunnels.on('open', function(tunnel) {
|
||||
tunnel_count++;
|
||||
debug('tunnel open [total: %d]', tunnel_count);
|
||||
|
||||
var close_handler = function() {
|
||||
tunnel.destroy();
|
||||
};
|
||||
|
||||
if (self._closed) {
|
||||
return close_handler();
|
||||
}
|
||||
|
||||
self.once('close', close_handler);
|
||||
tunnel.once('close', function() {
|
||||
self.removeListener('close', close_handler);
|
||||
});
|
||||
});
|
||||
|
||||
// when a tunnel dies, open a new one
|
||||
tunnels.on('dead', function(tunnel) {
|
||||
tunnel_count--;
|
||||
debug('tunnel dead [total: %d]', tunnel_count);
|
||||
|
||||
if (self._closed) {
|
||||
return;
|
||||
}
|
||||
|
||||
tunnels.open();
|
||||
});
|
||||
|
||||
// establish as many tunnels as allowed
|
||||
for (var count = 0 ; count < info.max_conn ; ++count) {
|
||||
tunnels.open();
|
||||
}
|
||||
};
|
||||
|
||||
Tunnel.prototype.open = function(cb) {
|
||||
var self = this;
|
||||
|
||||
self._init(function(err, info) {
|
||||
if (err) {
|
||||
return cb(err);
|
||||
}
|
||||
|
||||
self.url = info.url;
|
||||
self._establish(info);
|
||||
cb();
|
||||
});
|
||||
};
|
||||
|
||||
// shutdown tunnels
|
||||
Tunnel.prototype.close = function() {
|
||||
var self = this;
|
||||
|
||||
self._closed = true;
|
||||
self.emit('close');
|
||||
};
|
||||
var Tunnel = require('./lib/Tunnel');
|
||||
|
||||
module.exports = function localtunnel(port, opt, fn) {
|
||||
if (typeof opt === 'function') {
|
||||
@@ -312,4 +20,5 @@ module.exports = function localtunnel(port, opt, fn) {
|
||||
|
||||
fn(null, client);
|
||||
});
|
||||
return client;
|
||||
};
|
||||
|
||||
39
lib/HeaderHostTransformer.js
Normal file
39
lib/HeaderHostTransformer.js
Normal file
@@ -0,0 +1,39 @@
|
||||
var stream = require('stream');
|
||||
var util = require('util');
|
||||
|
||||
var Transform = stream.Transform;
|
||||
|
||||
var HeaderHostTransformer = function(opts) {
|
||||
if (!(this instanceof HeaderHostTransformer)) {
|
||||
return new HeaderHostTransformer(opts);
|
||||
}
|
||||
|
||||
opts = opts || {}
|
||||
Transform.call(this, opts);
|
||||
|
||||
var self = this;
|
||||
self.host = opts.host || 'localhost';
|
||||
self.replaced = false;
|
||||
}
|
||||
util.inherits(HeaderHostTransformer, Transform);
|
||||
|
||||
HeaderHostTransformer.prototype._transform = function (chunk, enc, cb) {
|
||||
var self = this;
|
||||
|
||||
// after replacing the first instance of the Host header
|
||||
// we just become a regular passthrough
|
||||
if (!self.replaced) {
|
||||
chunk = chunk.toString();
|
||||
self.push(chunk.replace(/(\r\n[Hh]ost: )\S+/, function(match, $1) {
|
||||
self.replaced = true;
|
||||
return $1 + self.host;
|
||||
}));
|
||||
}
|
||||
else {
|
||||
self.push(chunk);
|
||||
}
|
||||
|
||||
cb();
|
||||
};
|
||||
|
||||
module.exports = HeaderHostTransformer;
|
||||
158
lib/Tunnel.js
Normal file
158
lib/Tunnel.js
Normal file
@@ -0,0 +1,158 @@
|
||||
var url = require('url');
|
||||
var EventEmitter = require('events').EventEmitter;
|
||||
var axios = require('axios');
|
||||
var debug = require('debug')('localtunnel:client');
|
||||
|
||||
var TunnelCluster = require('./TunnelCluster');
|
||||
|
||||
var Tunnel = function(opt) {
|
||||
if (!(this instanceof Tunnel)) {
|
||||
return new Tunnel(opt);
|
||||
}
|
||||
|
||||
var self = this;
|
||||
self._closed = false;
|
||||
self._opt = opt || {};
|
||||
|
||||
self._opt.host = self._opt.host || 'https://localtunnel.me';
|
||||
};
|
||||
|
||||
Tunnel.prototype.__proto__ = EventEmitter.prototype;
|
||||
|
||||
// initialize connection
|
||||
// callback with connection info
|
||||
Tunnel.prototype._init = function(cb) {
|
||||
var self = this;
|
||||
var opt = self._opt;
|
||||
|
||||
var params = {
|
||||
responseType: 'json'
|
||||
};
|
||||
|
||||
var base_uri = opt.host + '/';
|
||||
|
||||
// optionally override the upstream server
|
||||
var upstream = url.parse(opt.host);
|
||||
|
||||
// no subdomain at first, maybe use requested domain
|
||||
var assigned_domain = opt.subdomain;
|
||||
|
||||
// where to quest
|
||||
var uri = base_uri + ((assigned_domain) ? assigned_domain : '?new');
|
||||
|
||||
(function get_url() {
|
||||
axios.get(uri, params)
|
||||
.then(function(res){
|
||||
var body = res.data;
|
||||
if (res.status !== 200) {
|
||||
var err = new Error((body && body.message) || 'localtunnel server returned an error, please try again');
|
||||
return cb(err);
|
||||
}
|
||||
var port = body.port;
|
||||
var host = upstream.hostname;
|
||||
var max_conn = body.max_conn_count || 1;
|
||||
cb(null, {
|
||||
remote_host: upstream.hostname,
|
||||
remote_port: body.port,
|
||||
name: body.id,
|
||||
url: body.url,
|
||||
max_conn: max_conn
|
||||
});
|
||||
})
|
||||
.catch(function(err){
|
||||
// TODO (shtylman) don't print to stdout?
|
||||
console.log('tunnel server offline: ' + err.message + ', retry 1s');
|
||||
return setTimeout(get_url, 1000);
|
||||
})
|
||||
})();
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
var tunnels = self.tunnel_cluster = TunnelCluster(info);
|
||||
|
||||
// only emit the url the first time
|
||||
tunnels.once('open', function() {
|
||||
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
|
||||
tunnels.on('open', function(tunnel) {
|
||||
tunnel_count++;
|
||||
debug('tunnel open [total: %d]', tunnel_count);
|
||||
|
||||
var close_handler = function() {
|
||||
tunnel.destroy();
|
||||
};
|
||||
|
||||
if (self._closed) {
|
||||
return close_handler();
|
||||
}
|
||||
|
||||
self.once('close', close_handler);
|
||||
tunnel.once('close', function() {
|
||||
self.removeListener('close', close_handler);
|
||||
});
|
||||
});
|
||||
|
||||
// when a tunnel dies, open a new one
|
||||
tunnels.on('dead', function(tunnel) {
|
||||
tunnel_count--;
|
||||
debug('tunnel dead [total: %d]', tunnel_count);
|
||||
|
||||
if (self._closed) {
|
||||
return;
|
||||
}
|
||||
|
||||
tunnels.open();
|
||||
});
|
||||
|
||||
tunnels.on('request', function(info) {
|
||||
self.emit('request', info);
|
||||
});
|
||||
|
||||
// establish as many tunnels as allowed
|
||||
for (var count = 0 ; count < info.max_conn ; ++count) {
|
||||
tunnels.open();
|
||||
}
|
||||
};
|
||||
|
||||
Tunnel.prototype.open = function(cb) {
|
||||
var self = this;
|
||||
|
||||
self._init(function(err, info) {
|
||||
if (err) {
|
||||
return cb(err);
|
||||
}
|
||||
|
||||
self.url = info.url;
|
||||
self._establish(info);
|
||||
cb();
|
||||
});
|
||||
};
|
||||
|
||||
// shutdown tunnels
|
||||
Tunnel.prototype.close = function() {
|
||||
var self = this;
|
||||
|
||||
self._closed = true;
|
||||
self.emit('close');
|
||||
};
|
||||
|
||||
module.exports = Tunnel;
|
||||
133
lib/TunnelCluster.js
Normal file
133
lib/TunnelCluster.js
Normal file
@@ -0,0 +1,133 @@
|
||||
var EventEmitter = require('events').EventEmitter;
|
||||
var debug = require('debug')('localtunnel:client');
|
||||
var net = require('net');
|
||||
|
||||
var HeaderHostTransformer = require('./HeaderHostTransformer');
|
||||
|
||||
// manages groups of tunnels
|
||||
var TunnelCluster = function(opt) {
|
||||
if (!(this instanceof TunnelCluster)) {
|
||||
return new TunnelCluster(opt);
|
||||
}
|
||||
|
||||
var self = this;
|
||||
self._opt = opt;
|
||||
|
||||
EventEmitter.call(self);
|
||||
};
|
||||
|
||||
TunnelCluster.prototype.__proto__ = EventEmitter.prototype;
|
||||
|
||||
// establish a new tunnel
|
||||
TunnelCluster.prototype.open = function() {
|
||||
var self = this;
|
||||
|
||||
var opt = self._opt || {};
|
||||
|
||||
var remote_host = opt.remote_host;
|
||||
var remote_port = opt.remote_port;
|
||||
|
||||
var local_host = opt.local_host || 'localhost';
|
||||
var local_port = opt.local_port;
|
||||
|
||||
debug('establishing tunnel %s:%s <> %s:%s', local_host, local_port, remote_host, remote_port);
|
||||
|
||||
// connection to localtunnel server
|
||||
var remote = net.connect({
|
||||
host: remote_host,
|
||||
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.
|
||||
if (err.code === 'ECONNREFUSED') {
|
||||
self.emit('error', new Error('connection refused: ' + remote_host + ':' + remote_port + ' (check your firewall settings)'));
|
||||
}
|
||||
|
||||
remote.end();
|
||||
});
|
||||
|
||||
function conn_local() {
|
||||
if (remote.destroyed) {
|
||||
debug('remote destroyed');
|
||||
self.emit('dead');
|
||||
return;
|
||||
}
|
||||
|
||||
debug('connecting locally to %s:%d', local_host, local_port);
|
||||
remote.pause();
|
||||
|
||||
// connection to local http server
|
||||
var local = net.connect({
|
||||
host: local_host,
|
||||
port: local_port
|
||||
});
|
||||
|
||||
function remote_close() {
|
||||
debug('remote close');
|
||||
self.emit('dead');
|
||||
local.end();
|
||||
};
|
||||
|
||||
remote.once('close', remote_close);
|
||||
|
||||
// TODO some languages have single threaded servers which makes opening up
|
||||
// multiple local connections impossible. We need a smarter way to scale
|
||||
// and adjust for such instances to avoid beating on the door of the server
|
||||
local.once('error', function(err) {
|
||||
debug('local error %s', err.message);
|
||||
local.end();
|
||||
|
||||
remote.removeListener('close', remote_close);
|
||||
|
||||
if (err.code !== 'ECONNREFUSED') {
|
||||
return remote.end();
|
||||
}
|
||||
|
||||
// retrying connection to local server
|
||||
setTimeout(conn_local, 1000);
|
||||
});
|
||||
|
||||
local.once('connect', function() {
|
||||
debug('connected locally');
|
||||
remote.resume();
|
||||
|
||||
var stream = remote;
|
||||
|
||||
// if user requested specific local host
|
||||
// then we use host header transform to replace the host header
|
||||
if (opt.local_host) {
|
||||
debug('transform Host header to %s', opt.local_host);
|
||||
stream = remote.pipe(HeaderHostTransformer({ host: opt.local_host }));
|
||||
}
|
||||
|
||||
stream.pipe(local).pipe(remote);
|
||||
|
||||
// when local closes, also get a new remote
|
||||
local.once('close', function(had_error) {
|
||||
debug('local connection closed [%s]', had_error);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
remote.on('data', function(data) {
|
||||
const match = data.toString().match(/^(\w+) (\S+)/);
|
||||
if (match) {
|
||||
self.emit('request', {
|
||||
method: match[1],
|
||||
path: match[2],
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// tunnel is considered open when remote connects
|
||||
remote.once('connect', function() {
|
||||
self.emit('open', remote);
|
||||
conn_local();
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = TunnelCluster;
|
||||
14
package.json
14
package.json
@@ -2,15 +2,17 @@
|
||||
"author": "Roman Shtylman <shtylman@gmail.com>",
|
||||
"name": "localtunnel",
|
||||
"description": "expose localhost to the world",
|
||||
"version": "1.1.2",
|
||||
"version": "1.9.2",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/shtylman/localtunnel.git"
|
||||
"url": "git://github.com/localtunnel/localtunnel.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"request": "2.11.4",
|
||||
"optimist": "0.3.4",
|
||||
"debug": "0.7.4"
|
||||
"axios": "0.19.0",
|
||||
"debug": "4.1.1",
|
||||
"openurl": "1.1.1",
|
||||
"yargs": "6.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "~1.17.0"
|
||||
@@ -22,4 +24,4 @@
|
||||
"lt": "./bin/client"
|
||||
},
|
||||
"main": "./client.js"
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,51 @@ test('request specific domain', function(done) {
|
||||
});
|
||||
});
|
||||
|
||||
suite('local-host');
|
||||
suite('--local-host localhost');
|
||||
|
||||
test('setup localtunnel client', function(done) {
|
||||
var opt = {
|
||||
local_host: 'localhost'
|
||||
};
|
||||
localtunnel(test._fake_port, opt, function(err, tunnel) {
|
||||
assert.ifError(err);
|
||||
assert.ok(new RegExp('^https:\/\/.*localtunnel.me' + '$').test(tunnel.url));
|
||||
test._fake_url = tunnel.url;
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('override Host header with local-host', function(done) {
|
||||
var uri = test._fake_url;
|
||||
var parsed = url.parse(uri);
|
||||
|
||||
var opt = {
|
||||
host: parsed.host,
|
||||
port: 443,
|
||||
headers: {
|
||||
host: parsed.hostname
|
||||
},
|
||||
path: '/'
|
||||
};
|
||||
|
||||
var req = https.request(opt, function(res) {
|
||||
res.setEncoding('utf8');
|
||||
var body = '';
|
||||
|
||||
res.on('data', function(chunk) {
|
||||
body += chunk;
|
||||
});
|
||||
|
||||
res.on('end', function() {
|
||||
assert.equal(body, 'localhost');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
req.end();
|
||||
});
|
||||
|
||||
suite('--local-host 127.0.0.1');
|
||||
|
||||
test('setup localtunnel client', function(done) {
|
||||
var opt = {
|
||||
@@ -111,3 +155,34 @@ test('override Host header with local-host', function(done) {
|
||||
|
||||
req.end();
|
||||
});
|
||||
|
||||
test('send chunked request', function(done) {
|
||||
var uri = test._fake_url;
|
||||
var parsed = url.parse(uri);
|
||||
|
||||
var opt = {
|
||||
host: parsed.host,
|
||||
port: 443,
|
||||
headers: {
|
||||
host: parsed.hostname,
|
||||
'Transfer-Encoding': 'chunked'
|
||||
},
|
||||
path: '/'
|
||||
};
|
||||
|
||||
var req = https.request(opt, function(res) {
|
||||
res.setEncoding('utf8');
|
||||
var body = '';
|
||||
|
||||
res.on('data', function(chunk) {
|
||||
body += chunk;
|
||||
});
|
||||
|
||||
res.on('end', function() {
|
||||
assert.equal(body, '127.0.0.1');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
req.end(require('crypto').randomBytes(1024 * 8).toString('base64'));
|
||||
});
|
||||
|
||||
451
yarn.lock
Normal file
451
yarn.lock
Normal file
@@ -0,0 +1,451 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
ansi-regex@^2.0.0:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
|
||||
integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8=
|
||||
|
||||
axios@0.19.0:
|
||||
version "0.19.0"
|
||||
resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.0.tgz#8e09bff3d9122e133f7b8101c8fbdd00ed3d2ab8"
|
||||
integrity sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ==
|
||||
dependencies:
|
||||
follow-redirects "1.5.10"
|
||||
is-buffer "^2.0.2"
|
||||
|
||||
builtin-modules@^1.0.0:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
|
||||
integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=
|
||||
|
||||
camelcase@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a"
|
||||
integrity sha1-MvxLn82vhF/N9+c7uXysImHwqwo=
|
||||
|
||||
cliui@^3.2.0:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d"
|
||||
integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=
|
||||
dependencies:
|
||||
string-width "^1.0.1"
|
||||
strip-ansi "^3.0.1"
|
||||
wrap-ansi "^2.0.0"
|
||||
|
||||
code-point-at@^1.0.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
|
||||
integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=
|
||||
|
||||
commander@0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-0.6.1.tgz#fa68a14f6a945d54dbbe50d8cdb3320e9e3b1a06"
|
||||
integrity sha1-+mihT2qUXVTbvlDYzbMyDp47GgY=
|
||||
|
||||
commander@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.0.0.tgz#d1b86f901f8b64bd941bdeadaf924530393be928"
|
||||
integrity sha1-0bhvkB+LZL2UG96tr5JFMDk76Sg=
|
||||
|
||||
debug@*, debug@=3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
|
||||
integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
|
||||
dependencies:
|
||||
ms "2.0.0"
|
||||
|
||||
debug@4.1.1:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
|
||||
integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
|
||||
dependencies:
|
||||
ms "^2.1.1"
|
||||
|
||||
decamelize@^1.1.1:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
||||
integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=
|
||||
|
||||
diff@1.0.7:
|
||||
version "1.0.7"
|
||||
resolved "https://registry.yarnpkg.com/diff/-/diff-1.0.7.tgz#24bbb001c4a7d5522169e7cabdb2c2814ed91cf4"
|
||||
integrity sha1-JLuwAcSn1VIhaefKvbLCgU7ZHPQ=
|
||||
|
||||
error-ex@^1.2.0:
|
||||
version "1.3.2"
|
||||
resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
|
||||
integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==
|
||||
dependencies:
|
||||
is-arrayish "^0.2.1"
|
||||
|
||||
find-up@^1.0.0:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f"
|
||||
integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=
|
||||
dependencies:
|
||||
path-exists "^2.0.0"
|
||||
pinkie-promise "^2.0.0"
|
||||
|
||||
follow-redirects@1.5.10:
|
||||
version "1.5.10"
|
||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a"
|
||||
integrity sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==
|
||||
dependencies:
|
||||
debug "=3.1.0"
|
||||
|
||||
get-caller-file@^1.0.1:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a"
|
||||
integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==
|
||||
|
||||
glob@3.2.3:
|
||||
version "3.2.3"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-3.2.3.tgz#e313eeb249c7affaa5c475286b0e115b59839467"
|
||||
integrity sha1-4xPusknHr/qlxHUoaw4RW1mDlGc=
|
||||
dependencies:
|
||||
graceful-fs "~2.0.0"
|
||||
inherits "2"
|
||||
minimatch "~0.2.11"
|
||||
|
||||
graceful-fs@^4.1.2:
|
||||
version "4.1.11"
|
||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
|
||||
integrity sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=
|
||||
|
||||
graceful-fs@~2.0.0:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-2.0.3.tgz#7cd2cdb228a4a3f36e95efa6cc142de7d1a136d0"
|
||||
integrity sha1-fNLNsiiko/Nule+mzBQt59GhNtA=
|
||||
|
||||
growl@1.7.x:
|
||||
version "1.7.0"
|
||||
resolved "https://registry.yarnpkg.com/growl/-/growl-1.7.0.tgz#de2d66136d002e112ba70f3f10c31cf7c350b2da"
|
||||
integrity sha1-3i1mE20ALhErpw8/EMMc98NQsto=
|
||||
|
||||
hosted-git-info@^2.1.4:
|
||||
version "2.7.1"
|
||||
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047"
|
||||
integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==
|
||||
|
||||
inherits@2:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
||||
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
|
||||
|
||||
invert-kv@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6"
|
||||
integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY=
|
||||
|
||||
is-arrayish@^0.2.1:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
|
||||
integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=
|
||||
|
||||
is-buffer@^2.0.2:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725"
|
||||
integrity sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==
|
||||
|
||||
is-builtin-module@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe"
|
||||
integrity sha1-VAVy0096wxGfj3bDDLwbHgN6/74=
|
||||
dependencies:
|
||||
builtin-modules "^1.0.0"
|
||||
|
||||
is-fullwidth-code-point@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb"
|
||||
integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs=
|
||||
dependencies:
|
||||
number-is-nan "^1.0.0"
|
||||
|
||||
is-utf8@^0.2.0:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72"
|
||||
integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=
|
||||
|
||||
jade@0.26.3:
|
||||
version "0.26.3"
|
||||
resolved "https://registry.yarnpkg.com/jade/-/jade-0.26.3.tgz#8f10d7977d8d79f2f6ff862a81b0513ccb25686c"
|
||||
integrity sha1-jxDXl32NefL2/4YqgbBRPMslaGw=
|
||||
dependencies:
|
||||
commander "0.6.1"
|
||||
mkdirp "0.3.0"
|
||||
|
||||
lcid@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835"
|
||||
integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=
|
||||
dependencies:
|
||||
invert-kv "^1.0.0"
|
||||
|
||||
load-json-file@^1.0.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0"
|
||||
integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=
|
||||
dependencies:
|
||||
graceful-fs "^4.1.2"
|
||||
parse-json "^2.2.0"
|
||||
pify "^2.0.0"
|
||||
pinkie-promise "^2.0.0"
|
||||
strip-bom "^2.0.0"
|
||||
|
||||
lru-cache@2:
|
||||
version "2.7.3"
|
||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952"
|
||||
integrity sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=
|
||||
|
||||
minimatch@~0.2.11:
|
||||
version "0.2.14"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.2.14.tgz#c74e780574f63c6f9a090e90efbe6ef53a6a756a"
|
||||
integrity sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=
|
||||
dependencies:
|
||||
lru-cache "2"
|
||||
sigmund "~1.0.0"
|
||||
|
||||
mkdirp@0.3.0:
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.0.tgz#1bbf5ab1ba827af23575143490426455f481fe1e"
|
||||
integrity sha1-G79asbqCevI1dRQ0kEJkVfSB/h4=
|
||||
|
||||
mkdirp@0.3.5:
|
||||
version "0.3.5"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.5.tgz#de3e5f8961c88c787ee1368df849ac4413eca8d7"
|
||||
integrity sha1-3j5fiWHIjHh+4TaN+EmsRBPsqNc=
|
||||
|
||||
mocha@~1.17.0:
|
||||
version "1.17.1"
|
||||
resolved "https://registry.yarnpkg.com/mocha/-/mocha-1.17.1.tgz#7f7671d68526d074b7bae660c9099f87e0ea1ccb"
|
||||
integrity sha1-f3Zx1oUm0HS3uuZgyQmfh+DqHMs=
|
||||
dependencies:
|
||||
commander "2.0.0"
|
||||
debug "*"
|
||||
diff "1.0.7"
|
||||
glob "3.2.3"
|
||||
growl "1.7.x"
|
||||
jade "0.26.3"
|
||||
mkdirp "0.3.5"
|
||||
|
||||
ms@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
||||
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
|
||||
|
||||
ms@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
|
||||
integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==
|
||||
|
||||
normalize-package-data@^2.3.2:
|
||||
version "2.4.0"
|
||||
resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f"
|
||||
integrity sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==
|
||||
dependencies:
|
||||
hosted-git-info "^2.1.4"
|
||||
is-builtin-module "^1.0.0"
|
||||
semver "2 || 3 || 4 || 5"
|
||||
validate-npm-package-license "^3.0.1"
|
||||
|
||||
number-is-nan@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
|
||||
integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=
|
||||
|
||||
openurl@1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/openurl/-/openurl-1.1.1.tgz#3875b4b0ef7a52c156f0db41d4609dbb0f94b387"
|
||||
integrity sha1-OHW0sO96UsFW8NtB1GCduw+Us4c=
|
||||
|
||||
os-locale@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9"
|
||||
integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=
|
||||
dependencies:
|
||||
lcid "^1.0.0"
|
||||
|
||||
parse-json@^2.2.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9"
|
||||
integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=
|
||||
dependencies:
|
||||
error-ex "^1.2.0"
|
||||
|
||||
path-exists@^2.0.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b"
|
||||
integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=
|
||||
dependencies:
|
||||
pinkie-promise "^2.0.0"
|
||||
|
||||
path-type@^1.0.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441"
|
||||
integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=
|
||||
dependencies:
|
||||
graceful-fs "^4.1.2"
|
||||
pify "^2.0.0"
|
||||
pinkie-promise "^2.0.0"
|
||||
|
||||
pify@^2.0.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
|
||||
integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw=
|
||||
|
||||
pinkie-promise@^2.0.0:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa"
|
||||
integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o=
|
||||
dependencies:
|
||||
pinkie "^2.0.0"
|
||||
|
||||
pinkie@^2.0.0:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
|
||||
integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA=
|
||||
|
||||
read-pkg-up@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02"
|
||||
integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=
|
||||
dependencies:
|
||||
find-up "^1.0.0"
|
||||
read-pkg "^1.0.0"
|
||||
|
||||
read-pkg@^1.0.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28"
|
||||
integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=
|
||||
dependencies:
|
||||
load-json-file "^1.0.0"
|
||||
normalize-package-data "^2.3.2"
|
||||
path-type "^1.0.0"
|
||||
|
||||
require-directory@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
|
||||
integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I=
|
||||
|
||||
require-main-filename@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1"
|
||||
integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=
|
||||
|
||||
"semver@2 || 3 || 4 || 5":
|
||||
version "5.5.1"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477"
|
||||
integrity sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==
|
||||
|
||||
set-blocking@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
|
||||
integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc=
|
||||
|
||||
sigmund@~1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590"
|
||||
integrity sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=
|
||||
|
||||
spdx-correct@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.0.tgz#05a5b4d7153a195bc92c3c425b69f3b2a9524c82"
|
||||
integrity sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==
|
||||
dependencies:
|
||||
spdx-expression-parse "^3.0.0"
|
||||
spdx-license-ids "^3.0.0"
|
||||
|
||||
spdx-exceptions@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz#2c7ae61056c714a5b9b9b2b2af7d311ef5c78fe9"
|
||||
integrity sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==
|
||||
|
||||
spdx-expression-parse@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0"
|
||||
integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==
|
||||
dependencies:
|
||||
spdx-exceptions "^2.1.0"
|
||||
spdx-license-ids "^3.0.0"
|
||||
|
||||
spdx-license-ids@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.1.tgz#e2a303236cac54b04031fa7a5a79c7e701df852f"
|
||||
integrity sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w==
|
||||
|
||||
string-width@^1.0.1, string-width@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
|
||||
integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=
|
||||
dependencies:
|
||||
code-point-at "^1.0.0"
|
||||
is-fullwidth-code-point "^1.0.0"
|
||||
strip-ansi "^3.0.0"
|
||||
|
||||
strip-ansi@^3.0.0, strip-ansi@^3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
|
||||
integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=
|
||||
dependencies:
|
||||
ansi-regex "^2.0.0"
|
||||
|
||||
strip-bom@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e"
|
||||
integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=
|
||||
dependencies:
|
||||
is-utf8 "^0.2.0"
|
||||
|
||||
validate-npm-package-license@^3.0.1:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a"
|
||||
integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==
|
||||
dependencies:
|
||||
spdx-correct "^3.0.0"
|
||||
spdx-expression-parse "^3.0.0"
|
||||
|
||||
which-module@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f"
|
||||
integrity sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=
|
||||
|
||||
wrap-ansi@^2.0.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85"
|
||||
integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=
|
||||
dependencies:
|
||||
string-width "^1.0.1"
|
||||
strip-ansi "^3.0.1"
|
||||
|
||||
y18n@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41"
|
||||
integrity sha1-bRX7qITAhnnA136I53WegR4H+kE=
|
||||
|
||||
yargs-parser@^4.2.0:
|
||||
version "4.2.1"
|
||||
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c"
|
||||
integrity sha1-KczqwNxPA8bIe0qfIX3RjJ90hxw=
|
||||
dependencies:
|
||||
camelcase "^3.0.0"
|
||||
|
||||
yargs@6.6.0:
|
||||
version "6.6.0"
|
||||
resolved "http://registry.npmjs.org/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208"
|
||||
integrity sha1-eC7CHvQDNF+DCoCMo9UTr1YGUgg=
|
||||
dependencies:
|
||||
camelcase "^3.0.0"
|
||||
cliui "^3.2.0"
|
||||
decamelize "^1.1.1"
|
||||
get-caller-file "^1.0.1"
|
||||
os-locale "^1.4.0"
|
||||
read-pkg-up "^1.0.1"
|
||||
require-directory "^2.1.1"
|
||||
require-main-filename "^1.0.1"
|
||||
set-blocking "^2.0.0"
|
||||
string-width "^1.0.2"
|
||||
which-module "^1.0.0"
|
||||
y18n "^3.2.1"
|
||||
yargs-parser "^4.2.0"
|
||||
Reference in New Issue
Block a user