should render page now

This commit is contained in:
Martin Donnelly 2016-02-17 11:20:09 +00:00
parent 5fff5400fc
commit 326b27499f

View File

@ -139,17 +139,17 @@ busEmitter.on('saveTempData', doInsertEvent);
// Socket Stuff
logger.info('Configuring WebSocket Listener...');
logger.info('Creating server...');
logger.trace('Creating server...');
var server = http.createServer(function (request, response) {
logger.info((new Date()) + ' Received request for ' + request.url);
response.writeHead(404);
response.end();
});
logger.info('Creating listener...');
logger.trace('Creating listener...');
server.listen(8031, function () {
logger.info((new Date()) + ' Server is listening on port 8031');
});
logger.info('Creating wsServer...');
logger.trace('Creating wsServer...');
var wsServer = new WebSocketServer({
httpServer: server,
// You should not use autoAcceptConnections for production
@ -166,11 +166,11 @@ function originIsAllowed(origin) {
}
wsServer.on('request', function (request) {
logger.trace('CREATING CONNECTION');
if (!originIsAllowed(request.origin)) {
// Make sure we only accept requests from an allowed origin
request.reject();
logger.debug((new Date()) + ' Connection from origin ' + request.origin + ' rejected.');
logger.error((new Date()) + ' Connection from origin ' + request.origin + ' rejected.');
return;
}