> ## Documentation Index
> Fetch the complete documentation index at: https://docs.playflowcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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 enabling one extra setting.

<Info>
  **Prerequisites**

  * A PlayFlow project with a build uploaded and ready
  * Access to the project **Settings** page in the dashboard
  * A WebGL client that connects over WebSockets
</Info>

## The Key Requirement: TCP with TLS

Web browsers require secure WebSocket connections (`wss://`) for WebGL games. To enable this, set your game server's port to use the **TCP** protocol and turn on the separate **TLS** option for that port.

<Warning>
  If your port uses `UDP`, or uses `TCP` without TLS enabled, WebGL clients will not be able to connect over `wss://`.
</Warning>

## How to Configure Your Server for WebGL

Follow these steps in your PlayFlow project dashboard:

<Steps>
  <Step title="Open Network Ports">
    Open the project **Settings** page in your dashboard and find the **Network Ports** section (under **Configuration**).
  </Step>

  <Step title="Set the protocol to TCP">
    For the port your game server uses, set the **Protocol** to **TCP**. The protocol control is a toggle between **UDP** and **TCP**.
  </Step>

  <Step title="Enable TLS">
    With TCP selected, a separate **TLS** checkbox appears for that port. Enable it.

    For example, if your server listens on port `8080`, your configuration should be:

    * **Port:** `8080`
    * **Protocol:** `TCP`
    * **TLS:** enabled
  </Step>

  <Step title="Save and Deploy">
    Save your configuration. Any new servers you deploy for this project will now support WebGL connections.
  </Step>
</Steps>

## 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

PlayFlow does not hand you a ready-made `wss://` URL — you build it from the connection details of your running server.

Read the connection host and port from the server's API response (`GET /api/v3/servers/{id}`), from the `network_ports[]` array. Each entry includes the public `host` and the proxy-allocated `external_port`. These values are also shown on the server's detail page in the dashboard as a copyable `host:port` value, with a shield indicator when TLS is enabled.

<Warning>
  The external port is allocated by the proxy and differs from the internal port your server listens on. Never hardcode a port — always read `external_port` from the response.
</Warning>

Construct your WebGL client's connection URL as:

```text theme={null}
wss://<host>:<external_port>
```

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Quick Start Guide" icon="rocket" href="../quickstart">
    Deploy your first game server.
  </Card>

  <Card title="Installation Guide" icon="download" href="installation">
    Review the setup and installation process.
  </Card>
</CardGroup>
