Fix: take “http.host” config entry into account.

This commit is contained in:
Julien Fontanet 2013-09-13 11:28:07 +02:00
parent 537e3b6f1f
commit 3f25d10e6f
2 changed files with 5 additions and 4 deletions

View File

@ -2,10 +2,10 @@
http:
# Address on which the server is listening on.
#
# Sets it to '*' to listen on all addresses.
# Sets it to '0.0.0.0' to listen on all addresses.
#
# Default: 127.0.0.1
#host: '*'
#host: '0.0.0.0'
# Port on which the server is listening on.
#

View File

@ -346,9 +346,10 @@ Q.ninvoke(require('fs'), 'readFile', __dirname +'/../config/local.yaml', {'encod
console.warn('[Warn] Servers in config file are no longer supported.');
}
var host = cfg.get('http', 'host');
var port = cfg.get('http', 'port');
http_serv = require('http').createServer().listen(port).on('listening', function () {
console.info('XO-Server Web server is listening on port '+ port +'.');
http_serv = require('http').createServer().listen(port, host).on('listening', function () {
console.info('XO-Server Web server is listening on port '+ host +':'+ port +'.');
});
xo.start(cfg);