My nodeJS code isn't working for some reason. I'm new to nodeJS, so excuse my ignorance. Here's the server code:
var http = require('http'); console.log("before"); var app = http.createServer(function (request, response) { console.log("Server Created"); }).listen(3000); var io = require('socket.io').listen(app); io.sockets.on('connection', function(socket) { console.log("Client Connected"); }); Here is my client code:
<script type="text/javascript"> var socketio = io.connect("http://localhost:3000"); </script> I run the server, then go to index.html which contains the client code. I feel like I must be missing something obvious :| Client Connected never prints.