title: Nodejs server only listens on localhost
body: <p>I created two virtual machines - One is Windows 7 and the other is RedHat 6.4. I am trying to run the simplest server on the RedHat machine and then access it from the Windows 7 machine. The problem is that I can't seem to make it work! </p>
  
  <p>This is my code (Simplest there is) : </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(8080);
  </code></pre>
  
  <p>Tried to listen(8080,"0.0.0.0" and "127.0.0.1"). Both didn't work.</p>
  
  <p>When I try to access with from the RedHat machine with "wget" command it works, but when I try to go to the Windows 7 machine and enter from chrome or even with "telnet IP 8080" it doesn't work.</p>
  
  <p>Both machines have access to the internet and I can also ping from each to other meaning there is connection between the two. </p>
  
  <p>Also I added the port to the iptables in RedHat and I think I allowed it in the firewall aswell. Just added a new rule that allows all ports.</p>
  
  <p>I wanted to add that I also made a Windows Server 2008 machine and I tried to run the node server there and connect to it from my Windows 7 machine, But still the same problem exactly! Can connect from the Windows Server machine but not from any other machine.</p>