Configuration file / token-based auth support

This commit is contained in:
Tim Ambler
2018-08-02 15:12:26 +00:00
parent d9fca62c17
commit 07013d3326
6 changed files with 132 additions and 4 deletions
+7 -3
View File
@@ -2,15 +2,15 @@
import 'localenv';
import optimist from 'optimist';
import log from 'book';
import Debug from 'debug';
import CreateServer from '../server';
import config from '../lib/config';
import _ from 'lodash';
const debug = Debug('localtunnel');
const argv = optimist
let argv = optimist
.usage('Usage: $0 --port [num]')
.options('secure', {
default: false,
@@ -38,10 +38,14 @@ if (argv.help) {
process.exit();
}
argv = _.merge(argv, config);
const server = CreateServer({
max_tcp_sockets: argv['max-sockets'],
secure: argv.secure,
domain: argv.domain,
require_token: argv.require_token,
tokens: argv.tokens
});
server.listen(argv.port, argv.address, () => {