Display an error message when the HTTP(S) server could not start.

This commit is contained in:
Julien Fontanet 2013-10-30 12:21:10 +01:00
parent ac39e3b98e
commit e69db958b2

View File

@ -161,11 +161,13 @@ xo.on('started', function () {
// } // }
// http_servers.forEach(function (http_server) { // http_servers.forEach(function (http_server) {
// new WSServer({ // http_server.on('connection', function () {
// 'server': http_server, // new WSServer({
// 'path': '/websockify', // 'server': http_server,
// }) // 'path': '/websockify',
// .on('connection', on_connection); // })
// .on('connection', on_connection);
// });
// }); // });
// }); // });
@ -198,10 +200,12 @@ xo.on('started', function () {
} }
http_servers.forEach(function (http_server) { http_servers.forEach(function (http_server) {
new WSServer({ http_server.on('connection', function () {
'server': http_server, new WSServer({
'path': '/api/', 'server': http_server,
}).on('connection', on_connection); 'path': '/api/',
}).on('connection', on_connection);
});
}); });
}); });
@ -380,7 +384,13 @@ read_file(__dirname +'/../config/local.yaml').then(
require('http').createServer().listen(port, host) require('http').createServer().listen(port, host)
.on('listening', function () { .on('listening', function () {
console.info( console.info(
'XO-Server HTTP server is listening on %s:%s', 'HTTP server is listening on %s:%s',
host, port
);
})
.on('error', function () {
console.warn(
'[Warn] HTTP server could not listen on %s:%s',
host, port host, port
); );
}) })
@ -402,7 +412,12 @@ read_file(__dirname +'/../config/local.yaml').then(
'key': key, 'key': key,
}).listen(port, host).on('listening', function () { }).listen(port, host).on('listening', function () {
console.info( console.info(
'XO-Server HTTPS server is listening on %s:%s', 'HTTPS server is listening on %s:%s',
host, port
);
}).on('error', function () {
console.warn(
'[Warn] HTTPS server could not listen on %s:%s',
host, port host, port
); );
}) })