[TASK] Add option to define the host to listen on.

This commit is contained in:
Jan Philipp Timme 2013-09-14 14:32:08 +02:00
parent 5bbc879029
commit f91afabfd1
2 changed files with 7 additions and 4 deletions

4
app.js
View File

@ -53,7 +53,7 @@ if(settings.general.https == true) {
"cert": fs.readFileSync(settings.https.cert),
"key": fs.readFileSync(settings.https.key)
};
https.createServer(httpsOptions, app).listen(settings.general.listen);
https.createServer(httpsOptions, app).listen(settings.general.listen.port, settings.general.listen.host);
} else {
http.createServer(app).listen(settings.general.listen);
http.createServer(app).listen(settings.general.listen.port, settings.general.listen.host);
}

View File

@ -3,7 +3,10 @@
//serve https or http?
//generate certs in ./snakeoil before activating this
"https": false,
"listen": 3000
"listen": {
"host": "localhost",
"port": 3000
}
},
"https": {
"key": "snakeoil/privkey.pem",