Add option to set server address

This commit is contained in:
Kaizhe Huang
2018-02-06 16:08:58 +08:00
parent 2a9bc27117
commit 45cc459763
+5 -1
View File
@@ -17,6 +17,10 @@ const argv = optimist
default: '80',
describe: 'listen on this port for outside requests'
})
.options('address', {
default: '0.0.0.0',
describe: 'IP address to bind to'
})
.options('max-sockets', {
default: 10,
describe: 'maximum number of tcp sockets each client is allowed to establish at one time (the tunnels)'
@@ -33,7 +37,7 @@ const server = require('../server')({
secure: argv.secure
});
server.listen(argv.port, () => {
server.listen(argv.port, argv.address, () => {
debug('server listening on port: %d', server.address().port);
});