Firewall and WebSocket Configuration of SmartFoxServer2X
- What are the things to do, to accept connections from remotely like firewall configurations etc., based on Operating System?
- How to configure Web sockets in SmartfoxServer2x?
>What are the things to do, to accept connections from remotely like firewall configurations etc., based on Operating System?
What is firewall why need to open port in firewall????
After initiating the server with port and Host information for remote connection acceptance we need to open the firewall with the configured port. Port and Firewall configuration will differ from Operating System to Operating System. Here I am mentioning Windows and Linux Firewall configurations in brief check it.
In Windows Machines
- Open the Windows Firewall in Control Panel.
- Choose Advance Settings in Windows Firewall Screen.
- Open the configured port in Inbound and Outbound , By choosing the links available at right side of the screen (Inbound Rules , Outbound Rules).
- Open the port in router if need
- Restart the SmartFoxServer2x.
- About Client server Communication in Smartfoxserver2x Previous:- ssss
- Next:- How to configure/handle Websocket and Firewall in Smartfoxserver2x
In Linux Machines (Ubuntu Flavour)
- Run the ufw command in terminal with root user privileges.
Example:-
sudo ufw allow 2016/tcp
sudo ufw allow 2016/udp
For Detail Information use this link http://www.cyberciti.biz/faq/how-to-open-firewall-port-on-ubuntu-linux-12-04-14-04-lts/
In Linux Machines (CentOS/Fedora Flavour) :-
- Configure the sbin/iptables to allow the ports as
1. /sbin/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 2016 -j ACCEPT
2. service iptables save
For detailed information of how to open ports in Centos/Fedora refer these links https://wiki.centos.org/HowTos/Network/IPTables https://ask.fedoraproject.org/en/question/8231/how-to-enable-a-port-in-firewall/
Where the server port is configured in SmartfoxServer2x?
top- SmartfoxServer2x consists a file named server.xml in the path Smartfox2x -> SFS2X-> Config-> server.xml.
- In that server.xml file a <socket> tag will hold’s port attribute there we need to modify. By default it will in the manner
<socket address="0.0.0.0" port="9933" type="TCP"/>
Attribute | Description |
---|---|
address | Refers the host/ip of server machine. |
port | SmartfoxServer2x will accept client connections to the specified port |
type | Protocol of communication allowed values or either TCP or UDP |