You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone,
I write a simple code to try sticky-session and socket-io.
With Google Chrome, I can see "Hello World!" return.
IE and FF keep loading and nothing return.
Can you give me hint how to settle my problem?
Here is the source:
var sticky = require('sticky-session');
var fs = require('fs');
sticky(function () {
// This code will be executed only in slave workers
var http = require('http'),
io = require('socket.io');
var server = http.createServer(function (req, res) {
if (req.url === '/' || req.url === '/index.html') {
fs.readFile(__dirname + '/statics/html/index.html',
function (err, data) {
if (err) {
res.writeHead(500);
return res.end('Error loading index.html');
}
res.writeHead(200, {'Content-Type': 'text/html'});
res.end(data);
});
}
});
io.listen(server);
return server;
}).listen(8000, function () {
console.log('server started on 8000 port');
});
Index.html
<title></title>
Hello
World!
The text was updated successfully, but these errors were encountered:
Hi everyone,
I write a simple code to try sticky-session and socket-io.
With Google Chrome, I can see "Hello World!" return.
IE and FF keep loading and nothing return.
Can you give me hint how to settle my problem?
Here is the source:
var sticky = require('sticky-session');
var fs = require('fs');
sticky(function () {
// This code will be executed only in slave workers
}).listen(8000, function () {
console.log('server started on 8000 port');
});
Index.html
<title></title>Hello
World!
The text was updated successfully, but these errors were encountered: