I deployed node.js to Amazon EC2 Windows instance. Here is the js code which I run:
require('http').createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(80);
It works perfectly when I am accessing http://localhost But it doesn't work when I'm trying to access the server through external IP: http://[external IP]
when I run "netstat -ano" I can see this line:
0.0.0.0:80
if I run IIS, then it adds two lines
0.0.0.0:80
[::]:80
What does [::] mean? And why it's not added when I run node.js? I think, that is why node.js isn't serving requests to external IP. How can I make node.js work on Windows?
[::]:80is for IPv6; you can disable IPv6 by going to your network adapter properties and unchecking it. As for why it's not working, have you added an exception to your Windows Firewall for HTTP (port 80)? – gravyface Nov 14 '11 at 11:42