title: Node.js: can't get socket.io to work with express, getting 404s on script file
body: <p>I'm trying to use express to serve static pages with express that communicate with socket.io.  I keep running into problem after problem.  I have done so many things, and googled so many times, that I can't believe I haven't found an answer to my specific problem.  I keep running into places that show you the server, or show you the client, but not the other that communicates with it.  Or both, but not with express.  When I throw express into the mix, I start getting 404s and I them move my socket.io client scripts around and still can't seem to get it to work.  This is where I'm at right now, though this is about my 20th configuration.</p>
  
  <p>Server:</p>
  
  <pre><code>var express = require('express');
  var app = express();
  var http = require('http');
  var server = http.createServer(app);
  var io = require('socket.io').listen(server);
  
  app.configure(function () {
      app.use(express.static('html'));
  });
  
  app.listen(8080);
  
  io.sockets.on('connection', function (socket) {
      console.log('A socket connected!');
  }); 
  </code></pre>
  
  <p>Client:</p>
  
  <pre><code>&lt;script src="/socket.io/socket.io.js"&gt;&lt;/script&gt;
  &lt;script&gt;
    var socket = io.connect('http://localhost:8080');
    socket.send('testing');
  &lt;/script&gt;
  </code></pre>
  
  <p>I have tried changing the src to /html/socket.io.js (and copied all necessary files from the dist directory to /html), tried creating a scripts directory in the html directory, tried linking to socket.io's cdn, and I keep getting 404s.  I know it's something stupid and simple that I'm messing up, I just can't figure it out for the life of me.  Thanks!</p>
  
  <p>edit: all I want to do right now is serve the index.html page and print to the server console when it sees the connection.</p>