NodeJS server not accessible from outside
I think you should try not specifying an IP.
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Simple server\n');
}).listen(8080);
console.log('Server running at http://0.0.0.0:8080/');
I am pretty sure that you have to use
iptables -A OUTPUT -p tcp --sport 8080 -j ACCEPT
for the outgoing rule (not dport
). Apart from that, maybe there's an earlier rule that blocks the traffic? Try iptables -L
.