mirror of
https://github.com/bitinflow/server.git
synced 2026-03-13 13:35:53 +00:00
Add option to set server address (#80)
Since this server may run behind a reverse proxy like Nginx, it should be able to bind to localhost only rather than listening to the whole network.
This commit is contained in:
committed by
Roman Shtylman
parent
2a9bc27117
commit
d7852a3dd1
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user