SFS2X Docs / GettingStarted / migration-213
» Websocket migration, release 2.13+
A number of different things have changed for websockets with the release of SmartFoxServer 2.13:
- Websocket ports
- Websocket protocol
- Unity WebGL / C# API implementing standard SFS2X binary protocol
» Websocket ports
Starting from v2.13, SmartFoxServer uses the Jetty Web Server to run all HTTP-related services, including websockets. This means that you no longer have to setup different TCP ports for HTTP/HTTPS services and WS/WSS services. Instead all services now run on two main TCP ports, which by default are:
- HTTP / WS / BlueBox = 8080
- HTTPS / WSS = 8443
If you want to change these ports you can do so via the AdminTool > Server Settings > Web Server tab.
Please note: out of the box, the websocket services are not active. You can turn them on via the "Enable WS/WSS" switch shown in the image above, choose the type of protocol (default = binary; read below) and restart the server.
» Client API and protocol
By default the server uses the new protocol but you can still revert to the previous version by switching off the "Use WS binary protocol" option from the picture above.
For all new HTML5 / Unity WebGL projects we highly recommend to start working with the new binary protocol API as this is more compact and efficient. Also this is the API we will focus on for the incoming future.
For older projects based on the previous API we will keep maintaining the code in terms of bug fixes, but we won't add any new features. With time we would encourage previous projects to migrate, if possible, to the new API.
» Compatibility notes for older projects
- Install SFS2X v2.13 or later
- Run the AdminTool > Server Settings > Web server and change the following:
- Turn on "Enable WS/WSS"
- Turn off "Use WS binary protocol"
- If your application runs with WSS you will need to make sure that the SSL certificate is properly deployed in Jetty; you can follow these instructions to do so
- Restart SFS2X
- Change your client's WS/WSS ports to the new values used in SFS2X v2.13
- Double check your firewall configuration to make sure the WS/WSS traffic is allowed on the new ports
If you have any questions or problems with websocket settings you can reach us through our support forum.