Node.js HTTP Server port 8080
21:27 26 Oct 2013

I am running through some of the node.js tutorials. I am using OS X 10.6.8. One of the first is the following.

var http = require("http");
http.createServer(function (request, response) {
   request.on("end", function () {
      response.writeHead(200, {
         'Content-Type': 'text/plain'
      });
      response.end('Hello HTTP!');
   });
// Listen on the 8080 port.
}).listen(8080);

I can't seem to access port 8080 at all. My localhost and 127.0.0.1 works fine when I access them but using the example above both 127.0.0.1:8080/ and localhost:8080/ but say "Safari can't connect to the server".

I assume this port is close some how? I am sure this is a common problem but searching is not helping much.

I should also add that the firewall is off in the Preferences.

Any ideas?

macos node.js port