Node.js script loading not loading from browser (outsider) but loading from command (localhost)

I have successfully installed Node.JS and Balloons.IO chatroom on my linux based vps (with SSH). When typing curl http://mydomain.com:9191/ in the ssh command I can see the html is loaded. But, when trying to reach the same page from my browser it takes some time loading then says page could not be reached. Any idea why ?

My common diagnostic steps:


1) Check that your app is actually listening on the port it should be, you can do this with:

sudo netstat -anp | grep :9191

You should see your app listening to 0.0.0.0:9191 or your.ip.address.here:9191 if you see something like 127.0.0.1:9191, then it is only listening locally so you won't be able to reach it.

2) Ensure your firewall isn't blocking these ports, if you are using iptables you can check with:

sudo iptables --list

This will print the rules for your firewall and you can check if you port is blocked (or allowed).

3) Try connecting locally. My third step is generally to try it locally with curl, you did this step already but for other landing here you can do something like:

curl http://localhost:9191/

and see what you get back

4) Try connecting remotely. If everything above looks fine, try running a verbose curl from a remote host and see what you get:

curl -v http://mydomain.com:9191/

This will show header and body output so you can see if the remote host even responds; if it doesn't then check if the raw port is even accessable with telnet:

telnet mydomain.com 9191

which if successful will print something like:

Trying your.ip.address.here...
Connected to mydomain.com.
Escape character is '^]'.

If it fails it will just hang at Trying... if it fails then your firewall is blocking the port, your host is blocking the port, or your app isn't listening to the port. If your above tests passed then contact your host because something else may be up and you should be able to get support from them.