2

This is so frustrating, trying to get a simple node.js + socket.io application going, but the client can't load the javascript library.

    GET http://localhost:4000/socket.io/socket.io.js 404 (Not Found)

Here is the node.js app:

var app = require('express').createServer();
var io = require('socket.io').listen(app);
io.set('log level', 1);

app.listen(4000);

app.get('/', function(req, res) {
    res.sendfile(__dirname + '/index.html');
});

io.sockets.on('connection', function(socket) {
    console.log("got a connection");
});

Any ideas what could be going on?

Justin
  • 42,716
  • 77
  • 201
  • 296
  • Please check my answer here: http://stackoverflow.com/questions/10191048/socket-io-js-not-found/10192084#10192084 – nguyenkha Apr 19 '12 at 02:40
  • Ok, got it working. Goosh, that is really confusing. Anyway to simply the following: http://pastie.org/3814384 – Justin Apr 19 '12 at 02:49

0 Answers0