mirror of
https://github.com/bitinflow/localtunnel.git
synced 2026-03-13 13:35:54 +00:00
Added the --local-host parameter to tunnel the traffic to other hosts
This commit is contained in:
@@ -11,12 +11,17 @@ var argv = require('optimist')
|
||||
.options('subdomain', {
|
||||
describe: 'request this subdomain'
|
||||
})
|
||||
.options('local-host', {
|
||||
describe: 'tunnel traffic to this host instead of localhost'
|
||||
})
|
||||
.default('local-host', 'localhost')
|
||||
.describe('port', 'internal http server port')
|
||||
.argv;
|
||||
|
||||
var opt = {
|
||||
host: argv.host,
|
||||
port: argv.port,
|
||||
local_host: argv['local-host'],
|
||||
subdomain: argv.subdomain,
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@ var request_url = function(params, cb) {
|
||||
var connect = function(opt) {
|
||||
var ev = new EventEmitter();
|
||||
|
||||
// local host
|
||||
var local_host = opt.local_host;
|
||||
|
||||
// local port
|
||||
var local_port = opt.port;
|
||||
|
||||
@@ -39,7 +42,7 @@ var connect = function(opt) {
|
||||
};
|
||||
|
||||
var local_opt = {
|
||||
host: 'localhost',
|
||||
host: local_host,
|
||||
port: local_port
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user