KVM frontend : console.log and server launch are asynchronous, so move up the...

KVM frontend : console.log and server launch are asynchronous, so move up the message log before we start server
parent 4988e744
......@@ -92,13 +92,15 @@ var proxyServer = httpProxy.createServer(
}}
);
console.log('HTTPS server starting and trying to listen on ' +
listenInterface + ':' + port);
// Release the beast.
proxyServer.listen(port, listenInterface);
console.log('HTTPS server started and listening at ' + listenInterface + ':' +
port);
// Dummy HTTP server redirecting to HTTPS. Only has sense if we can use port 80
if (redirect === '1') {
console.log('HTTP redirect server starting and trying to listen on ' +
listenInterface + ':' + httpPort);
try {
var httpPort = 80;
http.createServer(function(req, res) {
......@@ -120,8 +122,6 @@ if (redirect === '1') {
res.setHeader('Location', url);
res.end();
}).listen(httpPort, listenInterface);
console.log('HTTP redirect server started and listening at ' +
listenInterface + ':' + httpPort);
} catch (error) {
console.log('Couldn\'t start plain HTTP redirection server : ' + error)
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment