mirror of
https://github.com/mclueppers/xo-server.git
synced 2025-04-08 20:55:02 +02:00
Display an error message when the HTTP(S) server could not start.
This commit is contained in:
parent
ac39e3b98e
commit
e69db958b2
37
src/main.js
37
src/main.js
@ -161,11 +161,13 @@ xo.on('started', function () {
|
||||
// }
|
||||
|
||||
// http_servers.forEach(function (http_server) {
|
||||
// new WSServer({
|
||||
// 'server': http_server,
|
||||
// 'path': '/websockify',
|
||||
// })
|
||||
// .on('connection', on_connection);
|
||||
// http_server.on('connection', function () {
|
||||
// new WSServer({
|
||||
// 'server': http_server,
|
||||
// 'path': '/websockify',
|
||||
// })
|
||||
// .on('connection', on_connection);
|
||||
// });
|
||||
// });
|
||||
// });
|
||||
|
||||
@ -198,10 +200,12 @@ xo.on('started', function () {
|
||||
}
|
||||
|
||||
http_servers.forEach(function (http_server) {
|
||||
new WSServer({
|
||||
'server': http_server,
|
||||
'path': '/api/',
|
||||
}).on('connection', on_connection);
|
||||
http_server.on('connection', function () {
|
||||
new WSServer({
|
||||
'server': http_server,
|
||||
'path': '/api/',
|
||||
}).on('connection', on_connection);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -380,7 +384,13 @@ read_file(__dirname +'/../config/local.yaml').then(
|
||||
require('http').createServer().listen(port, host)
|
||||
.on('listening', function () {
|
||||
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
|
||||
);
|
||||
})
|
||||
@ -402,7 +412,12 @@ read_file(__dirname +'/../config/local.yaml').then(
|
||||
'key': key,
|
||||
}).listen(port, host).on('listening', function () {
|
||||
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
|
||||
);
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user