Application work fine on localhost .but when its connect to server it getting error.
I connect server through port 22
This is the error
Error:
I think you are using a Unix based OS, if that is the case then you can't use any port below 1024 without sudo access.
Also before digging too deep check that the listening port is not being used by any other process.
A quick fix (for development only):
sudo node file.js
orserver.listen(3000); // any number > 1024For production (never run node on production with root access.)
you have to map the listening port (ex:3000) to 80 using ip tables
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000