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