Players reach your server through a port. This page shows how to set one up and what your server should listen on.

Name your ports

Your project’s ports decide which ports your server uses. You can have up to 8. Each one has a name and a type, UDP or TCP. A new project starts with one UDP port named game, listening on 7777. A name starts with a letter, uses only letters, numbers and underscores, is at most 32 characters long, and must still be different from your other port names when written in capital letters. Most games only need one port, named game.

Listen on the right port

Simpl gives your server one environment variable for each port:
  • SIMPL_PORT_GAME is your game port.
  • SIMPL_PORT_<NAME> is any other port. A port named voice gives you SIMPL_PORT_VOICE.
If none of your ports is named game, SIMPL_PORT_GAME holds the number of your first port. By default the game port is 7777 (UDP). A server that listens on 7777 works without any changes. If you set a different port, read SIMPL_PORT_GAME when your server starts instead of typing the number into your code. To change the port your game server listens on, open your project’s Environment tab and click Edit ports in the Ports section. If your server listens on 7777 over UDP, you don’t need to change anything. With the API, send ports in Update a project. Each port has a name, a protocol and an internal_port. Servers started after you save use the new ports. Running servers keep their old ones.

Browser games and TLS

A browser game on an https page can only connect with wss://. For that, set the port to TCP and turn on TLS in the Ports section, or click Browser / WebSocket game. In the API, set tls_enabled to true on a TCP port. It defaults to false. Simpl handles the encryption. Your game still listens on plain TCP. Players connect with wss:// and the server’s host name, never its IP address. A TLS port accepts wss:// only, so add a second TCP port if you also need plain ws://. TLS works on TCP ports only: a UDP port with tls_enabled is refused with the error TLS_REQUIRES_TCP. See Browser games (wss://) for the steps.

Listen on the right address

Listen on the address in SIMPL_UDP_BIND_ADDRESS for UDP ports, and on the address in SIMPL_TCP_BIND_ADDRESS for TCP ports. Use it exactly as given. Unreal’s default setup already works on Simpl.

How players connect

When you start a server, the response includes network_ports. Each entry has a host and an external_port. Players connect to that host and port. For a port with TLS on (tls_enabled is true), they connect with wss://<host>:<external_port>. The number is different from the one your server listens on, and that is normal.

Your own environment variables

You can add your own variables in the dashboard or with the API. Names that start with SIMPL_ are reserved for the system, and so are a few others. If the API says a name is reserved, pick another. Your variables can’t replace the ones Simpl sets.

If players can’t connect

Your server may look fine in the dashboard while players time out. Check that it listens on the port in SIMPL_PORT_GAME and on the address Simpl gave you.