Pass landing page via cmd line arguments #150
+5
-1
@@ -31,6 +31,10 @@ const argv = optimist
|
|||||||
default: 10,
|
default: 10,
|
||||||
describe: 'maximum number of tcp sockets each client is allowed to establish at one time (the tunnels)'
|
describe: 'maximum number of tcp sockets each client is allowed to establish at one time (the tunnels)'
|
||||||
})
|
})
|
||||||
|
.options('landing', {
|
||||||
|
default: 'https://localtunnel.github.io/www/',
|
||||||
|
describe: 'Landing page'
|
||||||
|
})
|
||||||
.argv;
|
.argv;
|
||||||
|
|
||||||
if (argv.help) {
|
if (argv.help) {
|
||||||
@@ -42,6 +46,7 @@ const server = CreateServer({
|
|||||||
max_tcp_sockets: argv['max-sockets'],
|
max_tcp_sockets: argv['max-sockets'],
|
||||||
secure: argv.secure,
|
secure: argv.secure,
|
||||||
domain: argv.domain,
|
domain: argv.domain,
|
||||||
|
landing: argv.landing
|
||||||
});
|
});
|
||||||
|
|
||||||
server.listen(argv.port, argv.address, () => {
|
server.listen(argv.port, argv.address, () => {
|
||||||
@@ -65,4 +70,3 @@ process.on('unhandledRejection', (reason, promise) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// vim: ft=javascript
|
// vim: ft=javascript
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export default function(opt) {
|
|||||||
|
|
||||||
const validHosts = (opt.domain) ? [opt.domain] : undefined;
|
const validHosts = (opt.domain) ? [opt.domain] : undefined;
|
||||||
const myTldjs = tldjs.fromUserSettings({ validHosts });
|
const myTldjs = tldjs.fromUserSettings({ validHosts });
|
||||||
const landingPage = opt.landing || 'https://localtunnel.github.io/www/';
|
const landingPage = opt.landing;
|
||||||
|
|
||||||
function GetClientIdFromHostname(hostname) {
|
function GetClientIdFromHostname(hostname) {
|
||||||
return myTldjs.getSubdomain(hostname);
|
return myTldjs.getSubdomain(hostname);
|
||||||
|
|||||||
Reference in New Issue
Block a user