Monday, September 10, 2012

Websockets deployment on a dedicated server

I was able to test a websockets based application perfectly on my localhost but when I tried to deploy it on the production server there were problems.

Here is what I did : 

1. Edit the file : /etc/sysconfig/iptables
and add this line : 
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8123 -j ACCEPT
assuming that you want to run your websocket server on port 8123.

2. service iptables restart

3. When you start your websocket server, start it on 0.0.0.0. It will ensure that it's open to connection on all interfaces - be it LAN or external IPs.

4. To test whether it's accepting connection on the above port, do telnet IP Port. If it's successful then you can proceed with your websocket related stuff.

No comments:

Blog Archive