title: connection refused node js
body: <p>Helle every body i desired to test sockets,when i'm connected a alert should appear, it work on the computer where Node js is in installed but not in the other computer.</p>
  
  <p><strong>The error :</strong></p>
  
  <blockquote>
    <p>Failed to load resource: net::ERR_CONNECTION_REFUSED
    <a href="http://xxx.xxx.xxx.xxx:8080/socket.io/socket.io.js" rel="nofollow noreferrer">http://xxx.xxx.xxx.xxx:8080/socket.io/socket.io.js</a> Uncaught
    ReferenceError: io is not defined</p>
  </blockquote>
  
  <p><strong>the code :</strong> 
      server:</p>
  
  <pre><code>var http = require('http');
  var fs   = require('fs');
  var io = require('socket.io');
  
  var server = http.createServer(function(req,res){
      res.writeHead(200,{'Content-Type' : 'text/html'});
      fs.readFile('./index.html',function(err,content){
          res.end(content);
      });
  
  }).listen(8080);
  
  io = io.listen(server)
  
  io.sockets.on('connection',function(client){
  
  client.emit('connecte');
  
  });
  </code></pre>
  
  <p><strong>client :</strong> </p>
  
  <pre><code>&lt;html&gt;
  &lt;meta charset='utf-8'/&gt;
  &lt;head&gt;
      &lt;title&gt;my first page&lt;/title&gt;
  &lt;script src="http://localhost:8080/socket.io/socket.io.js" &gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;It work&lt;/h1&gt;
  &lt;/body&gt;
  &lt;script&gt;
  var socket; 
  
  socket = io.connect('http://localhost:8080');
  
  socket.on('connecte', function(){
          alert('You are connected');
      });
  
  &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>sorry for the language english is not my first language i try to learn.
  Thanks</p>