I have my mac mini running a nodejs server on port 8000. On the mac, I can hit it at 127.0.0.1:8000/something. I get back a "hello world" type of response.
On the same network, from a different machine, I cannot hit this server on the mac. I am getting time outs. I have been pulling my hair out trying to understand why.
I check the machine on the local net. For instance 192.168.1.7:8000 should resolve to that machine and port from another machine. Times out.
I have a NAS admin page sitting at 192.168.1.200:5000 (sorry about that typo before) and it resolves beautifully. Port 5000 is forwarded to the NAS from the router.
I have set up the firewall rules (on the router) in exactly the same way for nodejs as I did for the NAS. The NAS is available outside of my network via a router rule and a no-ip dynamic DNS mapping. The nodejs server is forwarded the same way. No dice, times out.
Any thoughts? I have no firewall (that I can detect) on the mac. I can see the server listening to 8000 on the mac. It works locally.
What am I doing wrong here?
UPDATES with answers to questions.
Thank you all for the feedback, Here are the answers to your questions.
Output from netstat.
netstat -anp tcp | grep 8000
tcp4 0 0 *.8000 *.* LISTEN
I do not have the mac firewall running (at least in the system settings I mean). I have seen posts about something called IPFW, but I have no idea what that is.
On the mac, when I hit 192.168.1.7:8000 I get:
Hello World
My understanding of nodejs is that I just "bind it" to a port. Here is the code, right out of their example.
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(8000);
console.log('Server running at http://127.0.0.1:8000/');
netstat -anp tcp | grep 8000on the host that's running nodejs, which will show the state of listening and active TCP connections on port 8000. – Kyle Jones Mar 12 '12 at 18:17127.0.0.1and not the LAN IP. – David Schwartz Mar 12 '12 at 20:05