title: Can't connect to nodejs server
body: <p>I run Apache on my server. Going to my address x.x.x.x:port loads the index.html page in /var/www. When I stop the server, I can no longer connect (all good).</p>
  
  <p>Now I start the node server with <code>node server.js</code> (the server.js file below is also located in /var/www).</p>
  
  <pre><code>var http = require('http');
  http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end('Hello World\n');
  }).listen(port, 'x.x.x.x');
  console.log('Server running at http://x.x.x.x:port/');
  </code></pre>
  
  <p>This gives the error <code>listen EADDRNOTAVAIL</code>, but I am not running any other node server (there is no other process running at this port).</p>
  
  <p>I have also tried omitting the IP address and just listening thus: <code>listen(port);</code></p>
  
  <p>This returns no errors, but I cannot connect to the server (Browser says: <code>Firefox can't establish a connection to the server at x.x.x.x:p.</code>)</p>