This question has been asked previously but haven\'t found any solution in prior replies.
Socket.IO gives me two problems:
The problem here is that you're telling Socket.IO to listen on a server that does not yet exist, causing an EACCES
and therefore not serving the client file. This is what you're doing:
// the HTTP server doesn't exist yet
var io = require('socket.io').listen(server);
var server = http.createServer();
And if you saw in your server-side error console, you get this:
info: socket.io started
warn: error raised: Error: listen EACCES
To fix this, move your listen function to after the server is created:
var server = http.createServer();
var io = require('socket.io').listen(server);
Once Socket.IO listens properly, it will automatically serve the client file to /socket.io/socket.io.js
. You don't need to find it or serve it manually.