WebGL Deployments
Learn how to configure your servers to accept connections from WebGL clients.
WebGL Deployments
To allow players to connect to your game servers from web-based games (WebGL), you must configure your server’s network port to accept secure connections. The process is simple and only requires one setting change.
The Key Requirement: TCP + TLS
Web browsers require secure WebSocket connections (wss://
) for WebGL games. To enable this, all you need to do is set your game server’s network configuration to use TCP + TLS on the port your players connect to.
If your port is set to standard TCP
or UDP
, WebGL clients will not be able to connect.
How to Configure Your Server for WebGL
Follow these steps in your PlayFlow project dashboard:
Navigate to Network Configuration
Go to the Configuration tab in your project dashboard and locate the Network Configuration section.
Set Port Protocol
For the port your game server uses, change the protocol from TCP
to TCP + TLS
.
For example, if your server listens on port 8080
, your configuration should be:
- Port:
8080
- Protocol:
TCP + TLS
Save and Deploy
Save your configuration. Any new servers you deploy for this project will now support WebGL connections.
How It Works
You don’t need to change your server code. Your game server can continue to listen for unencrypted TCP traffic on its port. PlayFlow automatically handles the TLS encryption and termination at our infrastructure level.
- Your WebGL Client: Connects to a secure
wss://
address. - PlayFlow Infrastructure: Receives the secure connection, handles the TLS, and forwards the traffic to your server as standard TCP.
- Your Game Server: Receives standard TCP traffic, no TLS implementation needed.
Client-Side Connection
When connecting from your WebGL client, make sure to use the secure wss://
URL provided on your server’s detail page in the dashboard.