Add option to set bind address

This commit is contained in:
Rodrigo Ramírez Norambuena 2016-11-25 20:14:34 -03:00
parent e210471c7a
commit df2ebbf384
2 changed files with 2 additions and 1 deletions

View File

@ -76,6 +76,7 @@ The following properties can be configured:
| **Option** | **Description** | | **Option** | **Description** |
| --- | --- | | --- | --- |
| `port` | The port on which the MagicMirror² server will run on. The default value is `8080`. | | `port` | The port on which the MagicMirror² server will run on. The default value is `8080`. |
| `address` | The ip address the accept connections. The default open bind `::` is IPv6 is available or `0.0.0.0` IPv4 run on. Example config: `192.168.10.100`. |
| `ipWhitelist` | The list of IPs from which you are allowed to access the MagicMirror². The default value is `["127.0.0.1", "::ffff:127.0.0.1", "::1"]`. It is possible to specify IPs with subnet masks (`["127.0.0.1", "127.0.0.1/24"]`) or define ip ranges (`["127.0.0.1", ["192.168.0.1", "192.168.0.100"]]`).| | `ipWhitelist` | The list of IPs from which you are allowed to access the MagicMirror². The default value is `["127.0.0.1", "::ffff:127.0.0.1", "::1"]`. It is possible to specify IPs with subnet masks (`["127.0.0.1", "127.0.0.1/24"]`) or define ip ranges (`["127.0.0.1", ["192.168.0.1", "192.168.0.100"]]`).|
| `kioskmode` | This allows MagicMirror² to run in Kiosk Mode. It protects from other programs popping on top of your screen. The default value is `false`| | `kioskmode` | This allows MagicMirror² to run in Kiosk Mode. It protects from other programs popping on top of your screen. The default value is `false`|
| `language` | The language of the interface. (Note: Not all elements will be localized.) Possible values are `en`, `nl`, `ru`, `fr`, etc., but the default value is `en`. | | `language` | The language of the interface. (Note: Not all elements will be localized.) Possible values are `en`, `nl`, `ru`, `fr`, etc., but the default value is `en`. |

View File

@ -17,7 +17,7 @@ var helmet = require("helmet");
var Server = function(config, callback) { var Server = function(config, callback) {
console.log("Starting server op port " + config.port + " ... "); console.log("Starting server op port " + config.port + " ... ");
server.listen(config.port); server.listen(config.port, config.address ? config.address : null);
app.use(function(req, res, next) { app.use(function(req, res, next) {
var result = ipfilter(config.ipWhitelist, {mode: "allow", log: false})(req, res, function(err) { var result = ipfilter(config.ipWhitelist, {mode: "allow", log: false})(req, res, function(err) {