add --domain option to enable localtunnel servers on subdomains

This commit is contained in:
Roman Shtylman
2018-04-01 19:57:48 -07:00
parent 6b07a86ec1
commit 86dce49dd1
6 changed files with 76 additions and 9 deletions

View File

@@ -24,6 +24,9 @@ const argv = optimist
default: '0.0.0.0',
describe: 'IP address to bind to'
})
.options('domain', {
describe: 'Specify the base domain name. This is optional if hosting localtunnel from a regular example.com domain. This is required if hosting a localtunnel server from a subdomain (i.e. lt.example.dom where clients will be client-app.lt.example.come)',
})
.options('max-sockets', {
default: 10,
describe: 'maximum number of tcp sockets each client is allowed to establish at one time (the tunnels)'
@@ -37,7 +40,8 @@ if (argv.help) {
const server = CreateServer({
max_tcp_sockets: argv['max-sockets'],
secure: argv.secure
secure: argv.secure,
domain: argv.domain,
});
server.listen(argv.port, argv.address, () => {