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?

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.
Control Panel - >System and Security -> Windows Firewall.
  • 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.

In Linux Machines (Ubuntu Flavour)

  • Run the ufw command in terminal with root user privileges.
Command syntax is ufw allow port/protocol


sudo ufw allow 2016/tcp

sudo ufw allow 2016/udp

For Detail Information use this link

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

Where the server port is configured in SmartfoxServer2x?

  1. SmartfoxServer2x consists a file named server.xml in the path Smartfox2x -> SFS2X-> Config-> server.xml.
  2. 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="" 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
Copyright © 2018-2020 TutorialToUs. All rights reserved.