score:3

Accepted answer

I am betting the actual response contains the content of your test_socket.html. The problem is that there is no exception rule for loading the javascript file, the server always responds to requests by sending test_socket.html. The socket.io javscript file works, however, because socket.io itself intercepts this request and serves the socketio.js file (look in your console, it should say "served static content socket.io" or something along those lines)

I find that it is a lot easier to let a prebuilt framework deal with these kind of issues. Take a look at http://code.tutsplus.com/tutorials/using-nodejs-and-websockets-to-build-a-chat-service--net-34482. It's the tutorial that I used to get started, which introduces you into node.js, npm, express, jade and socket.io. Should get you started on building your first Web 2.0 app quite nicely!


Related Query

More Query from same tag