Skip to content

Commit

Permalink
Add ip setting (#582)
Browse files Browse the repository at this point in the history
* Add support for an IP address setting

* Provide default IP, update docs
  • Loading branch information
aaronbieber authored and jishi committed Dec 30, 2017
1 parent 5e31916 commit aecc8a0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -313,6 +313,7 @@ If you want to change default settings, you can create a settings.json file and
Available options are:

* port: change the listening port
* ip: change the listening IP
* https: use https which requires a key and certificate or pfx file
* auth: require basic auth credentials which requires a username and password
* announceVolume: the percentual volume use when invoking say/sayall without any volume parameter
Expand All @@ -328,6 +329,7 @@ Example:
"name": "ZiraRUS"
},
"port": 5005,
"ip": "0.0.0.0",
"securePort": 5006,
"https": {
"key": "/path/to/key.pem",
Expand Down
5 changes: 3 additions & 2 deletions server.js
Expand Up @@ -80,8 +80,9 @@ process.on('unhandledRejection', (err) => {
logger.error(err);
});

server.listen(settings.port, function () {
logger.info('http server listening on port', settings.port);
let host = settings.ip;
server.listen(settings.port, host, function () {
logger.info('http server listening on', host, 'port', settings.port);
});

server.on('error', (err) => {
Expand Down
1 change: 1 addition & 0 deletions settings.js
Expand Up @@ -16,6 +16,7 @@ function merge(target, source) {

var settings = {
port: 5005,
ip: "0.0.0.0",
securePort: 5006,
cacheDir: path.resolve(__dirname, 'cache'),
webroot: path.resolve(__dirname, 'static'),
Expand Down

0 comments on commit aecc8a0

Please sign in to comment.