Skip to content

Run your own

The default demo.silt.run room is great for trying things out, but you can run the reference room server yourself. It’s a small pure relay written in Go: no game logic, no CRDT, no durable state — just membership, the join snapshot, and relaying the two lanes between peers.

  • Serves one WebTransport room at /room/graveyard.
  • Relays presence datagrams and reliable events between peers (see the wire protocol).
  • Tracks membership: sends each newcomer a snapshot, broadcasts join / leave, and distinguishes a clean bye ("left") from a dead session ("timeout").
  • Generates a fresh ECDSA P-256 certificate at boot (validity ≤ 14 days, as required for serverCertificateHashes) and prints its SHA-256 hash.
  • Go (to build the server).
  • A secure context for the browser: serve your page from https:// or http://127.0.0.1 / http://localhost. WebTransport refuses to connect from an insecure origin.
  1. Build the server

    Terminal window
    cd room-server
    go build -o /tmp/silt-room-server .
  2. Run it

    By default it binds 127.0.0.1:4433. Override with the WT_BIND env var.

    Terminal window
    WT_BIND=127.0.0.1:4433 /tmp/silt-room-server

    On boot it prints the certificate hash and the listen address:

    CERT-SHA256-HEX: 9f86d081884c7d659a2feaa0c55ad015...
    silt room server listening on 127.0.0.1:4433 (room: /room/graveyard)
  3. Connect with the cert hash

    Because the dev certificate is self-signed, pin it with the certHash option (the CERT-SHA256-HEX value the server printed). The room URL is your bind address plus the room path.

    import { joinRoom } from "@silt/client";
    const room = await joinRoom("https://127.0.0.1:4433/room/graveyard", {
    id: "alice",
    certHash: "9f86d081884c7d659a2feaa0c55ad015...", // CERT-SHA256-HEX from the log
    });

The repo ships a local harness that builds the client and server, boots the server, scrapes the cert hash, and serves a demo page on a secure-context localhost port:

Terminal window
demo/run.sh
# then open in two browser tabs (set ?id=...):
# http://127.0.0.1:8780/page.html?id=alice
# http://127.0.0.1:8780/page.html?id=bob
demo/stop.sh

Move one peer and watch its presence sync to the other tab — two peers in one room, at zero box spend.