Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
server = http.createServer(function (req, res) {
res.writeHead(404);
res.end();
});
}
server.on('error', function (err) {
logger.error('httpServer error:', err.stack);
});
var port = config.getValue('port');
server.listen(port, function () {
logger.info('bound and listen at:', port);
});
WebSocketServer.call(self, {
'server' : server,
'path' : config.getValue('path')
});
self.on('error', function (err) {
logger.error('webSocketServer error:', err.stack);
});
self.on('connection', function (socket) {
logger.info('incoming socket connection');
var session = new Session(socket, self.roles);
session.on('attach', function (realm, defer) {
try {
logger.debug('attaching session to realm', realm);
res.end('This is the Nightlife-Rabbit WAMP transport. Please connect over WebSocket!');
});
}
server.on('error', function (err) {
logger.error('httpServer error:', err.stack);
});
var port = config.getValue('port');
if (port) {
server.listen(port, function () {
logger.info('bound and listen at:', port);
});
}
WebSocketServer.call(self, {
'server' : server,
'path' : config.getValue('path')
});
self.on('error', function (err) {
logger.error('webSocketServer error:', err.stack);
});
self.on('connection', function (socket) {
logger.info('incoming socket connection');
var session = new Session(socket, self.roles);
session.on('attach', function (realm, defer) {
try {
logger.debug('attaching session to realm', realm);