Why can’t I use port 80 in node.js? Also what are the rules of ports and ip addresses when I call the listen function in node.js. which ones are allowed and why?
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Yo');
}).listen(80, "127.0.0.1");
Thanks!!!
Port 80 is protected, you need to be root to use it: