Skip to content

Multiplayer Server

The En Parlant~ multiplayer relay is a lightweight WebSocket server written in Rust using Axum and socketioxide. It connects two players for real-time chess over Socket.IO, with no persistent storage and minimal resource requirements.

The relay server source code lives in the en-parlant-relay repository.

The default relay server works out of the box, but there are good reasons to run your own:

  • Privacy — all game traffic stays on your infrastructure
  • Lower latency — deploy closer to your players for faster move transmission
  • Independence — no dependency on the default relay’s uptime or availability

The relay repository includes a fly.toml configuration file, making Fly.io the easiest deployment path. Fly.io’s free tier is suitable for personal use.

  1. Install the Fly CLI:

    Terminal window
    curl -L https://fly.io/install.sh | sh
  2. Sign up or log in:

    Terminal window
    fly auth signup
    # or
    fly auth login
  3. Clone the relay and deploy:

    Terminal window
    git clone https://github.com/DarrellThomas/en-parlant-relay.git
    cd en-parlant-relay
    fly launch
    fly deploy

Fly.io will build the Rust binary, deploy it, and give you a public URL like your-app-name.fly.dev.

Build the relay from source and run it on any machine with a Rust toolchain.

  1. Clone and build:

    Terminal window
    git clone https://github.com/DarrellThomas/en-parlant-relay.git
    cd en-parlant-relay
    cargo build --release
  2. Run the server:

    Terminal window
    ./target/release/en-parlant-relay

    The server listens on port 3210 by default.

  3. For production use, run behind a reverse proxy (nginx, Caddy, or similar) to handle TLS termination. The relay itself speaks plain WebSocket — your proxy adds the wss:// encryption layer.

The server is very lightweight. It holds game rooms in memory, forwards moves between two players, and does nothing else. A small VPS or even a Raspberry Pi can handle it comfortably.

Once your relay is running, point En Parlant~ to it:

  1. Open Settings in En Parlant~
  2. Find the multiplayer relay server URL setting
  3. Enter your server’s WebSocket endpoint:
    • For Fly.io: wss://your-app-name.fly.dev
    • For self-hosted with TLS proxy: wss://relay.yourdomain.com
    • For local development: ws://localhost:3210

That’s it. The app will use your relay for all multiplayer games.

A few things to know about how the relay operates:

  • Room codes — The server generates 6-character game codes using an unambiguous character set. Characters that look alike are excluded (no 0/O, no 1/I/L) to avoid confusion when sharing codes verbally.

  • Room cleanup — Rooms are automatically removed after 30 minutes of inactivity. A cleanup task runs every 60 seconds to sweep idle rooms.

  • No persistent storage — All state lives in memory. If the server restarts, active rooms are lost. This is by design — the relay is stateless and trivially replaceable.

  • Minimal resources — The server uses very little CPU and memory. It only receives Socket.IO events from one player and forwards them to the other. There’s no game logic, no move validation, no database.