mirror of
https://github.com/mclueppers/xo-server.git
synced 2025-07-27 07:54:54 +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) {
|
// 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
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user