Configuration file / token-based auth support
This commit is contained in:
+7
-3
@@ -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, () => {
|
||||
|
||||
Reference in New Issue
Block a user