Add option to set server listen address #80

Merged
FiveYellowMice merged 1 commits from master into master 2018-04-02 00:37:46 +00:00
Showing only changes of commit 45cc459763 - Show all commits
+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);
});