I searched everywhere for the answer to this question, but I was out of luck.
I installed node.js on my server. I created a standard Hello World example, for example:
var http = require('http'); http.createServer(function (request, response) { response.writeHead(200, {'Content-Type': 'text/plain'}); response.end('Hello World\n'); }).listen(8080, "0.0.0.0"); console.log('Server running at http://0.0.0.0:8080/');
After running the script on the server:
node app.js
I can connect to port 808 and see the Hello World message, but when I try to connect to port 8080, my server externally receives the error "I can not connect to the server." I also tried this in my listening function:
etc.. }).listen(8080, "204.xxx.xxx.xxx");
(with my real external IP address) and no luck.
I tried to accept connections on 8080 by adding this to iptables:
iptables -A INPUT -p tcp --dport 8080 -j ACCEPT
but still hit the wall. When I run netstat, I get:
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN -
which, it seems to me, tells me that port 8080 is listening for connections.
So - what am I doing wrong here?