title: Simple nodeJS example not working with socket.io
body: <p>Have been struggling all day trying to make this simple example work using socket.io. I've tried initially on Windows 7 with Cygwin. Have since also tried on OS X, with the same result.</p>
  
  <p>When running the script, it shows this...</p>
  
  <pre><code>2 May 20:57:47 - socket.io ready - accepting connections
  </code></pre>
  
  <p>But visiting the index.html page doesnt show a client has even connected.</p>
  
  <p>index.html</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript" src="socket.io.js"&gt;&lt;/script&gt; 
  &lt;script type="text/javascript"&gt; 
      var socket = new io.Socket('localhost',{'port':8090});
  
      socket.connect();
  
      socket.on('connect', function(){
          console.log('connected');
          socket.send('hi!'); 
      });
  
      socket.on('message', function(data){ 
          console.log('message recived: ' + data);
      });
  
      socket.on('disconnect', function(){
          console.log('disconected');
      });
  &lt;/script&gt; 
  &lt;/head&gt;
  &lt;body&gt;&lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>server.js</p>
  
  <pre><code>var http = require('http'), io = require('socket.io'),
  
  server = http.createServer(function(req, res){ 
      res.writeHead(200, {'Content-Type': 'text/html'}); 
      res.end('&lt;h1&gt;Hello world&lt;/h1&gt;'); 
  });
  server.listen(8090);
  
  var socket = io.listen(server); 
  socket.on('connection', function(client){ 
      console.log('client connected');
  
      client.on('message', function(){ 
          console.log('message arrive');
          client.send('some message');
      });
  
      client.on('disconnect', function(){
          console.log('connection closed');
      });
  });
  </code></pre>
  
  <p>Any ideas on what I could be doing wrong? No console messages whatsoever are being displayed. Notably, when i use Firebug to look at the index.html page, no scripts are being embedded, which is odd..Not sure what could be causing that.</p>