node.js - Socket.IO Simple Example Not Working -
node.js - Socket.IO Simple Example Not Working -
i trying follow along simple illustration of socket.io located @ http://socket.io/get-started/chat/. far have next code in index.js file:
// index.js file var app = require('express')(); var http = require('http').server(app); var io = require('socket.io')(http); app.get('/', function(req, res){ res.sendfile('index.html'); }); io.on('connection', function(socket){ socket.on('chat message', function(msg){ console.log('message: ' + msg); }); }); http.listen(3000, function(){ console.log('listening on *:3000'); });the error getting is:
the connection ws://localhost:3000/socket.io/?eio=2&transport=websocket&sid=i0syirvhjc1guiafaaac interrupted while page loading.
i'm using firefox browse page. doesn't work in chrome.
taking illustration works fine me. error not same indicating (which fine since session not exist here):
{ code: 1, message: "session id unknown" }
is index.html in right path (visible app)?
node.js socket.io
Comments
Post a Comment