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( ...@@ -92,13 +92,15 @@ var proxyServer = httpProxy.createServer(
}} }}
); );
console.log('HTTPS server starting and trying to listen on ' +
listenInterface + ':' + port);
// Release the beast. // Release the beast.
proxyServer.listen(port, listenInterface); 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 // Dummy HTTP server redirecting to HTTPS. Only has sense if we can use port 80
if (redirect === '1') { if (redirect === '1') {
console.log('HTTP redirect server starting and trying to listen on ' +
listenInterface + ':' + httpPort);
try { try {
var httpPort = 80; var httpPort = 80;
http.createServer(function(req, res) { http.createServer(function(req, res) {
...@@ -120,8 +122,6 @@ if (redirect === '1') { ...@@ -120,8 +122,6 @@ if (redirect === '1') {
res.setHeader('Location', url); res.setHeader('Location', url);
res.end(); res.end();
}).listen(httpPort, listenInterface); }).listen(httpPort, listenInterface);
console.log('HTTP redirect server started and listening at ' +
listenInterface + ':' + httpPort);
} catch (error) { } catch (error) {
console.log('Couldn\'t start plain HTTP redirection server : ' + 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