sculk.network
Nightly Stable docs
sculkwormnightly · 39a95aaView in Stable docs

sculkworm documentation

sculkworm routes Minecraft Java Edition TCP connections by the hostname inside the initial Handshake packet. These pages cover running, configuring, operating, securing, and contributing to sculkworm.

Pages#

  • Getting started: build the container, configure routes, ping two hostnames, reload with SIGHUP, and shut down end to end.
  • Configuration: every SCULKWORM_* environment variable, the routes.json file format, and every validation error.
  • HTTP admin API: bearer-key tenancy, open and closed route endpoints, agent tokens, revocations, public HTTPS login/ticket endpoints, limits, and error codes. The machine-readable schema is openapi.yaml.
  • TypeScript SDK: zero-dependency sculkworm client for Node.js 18+, Deno, Bun, and Cloudflare Workers.
  • Deploying: Docker, Docker Compose, closed mode (TLS ALPN split, secrets file, sculkworm-agent, sculkworm-connect, systemd units, state v2 upgrade note), SIGHUP reloads, graceful shutdown, proxy limitations, and structured log events.
  • Security model: threat model, unauthenticated hostnames, open-relay and closed-mode trust boundaries, log sanitization, resource caps, and player IP visibility.
  • Minecraft protocol: Handshake wire format, closed-route answers on port 25565, the Minecraft 26.4 host query grammar, normalization rules, size limits, and rejection reasons.
  • Closed routes (specification): the agent and connect tunnel contract, its wire protocol with test vectors, browser and device login flows, authorizers, admin API additions, state version 2, and threat model.
  • sculk.network as an authorizer: admitting players who hold server.play on a sculk.network server using sculk.network's OIDC provider.
  • Real-client verification: automated minecraft-protocol offline/encrypted/26.4/servers.dat/closed-mode e2e checks and the manual checklist for real Discord, browser, Java sync-jar, and Prism Launcher runs.
  • Contributing: building from source, running Rust tests and live checks, code layout, conventions, and release status.
  • Releases: changes by release, under the sculkworm-v tags.

Glossary#

  • Relay: the sculkworm TCP server that accepts incoming Minecraft connections on one port, reads the Handshake packet, and splices each connection to a backend.
  • Route: a single entry in routes.json mapping one normalized domain name to one backend target.
  • Route table: the in-memory HashMap<Domain, Target> (RouteTable in src/routes.rs) loaded from SCULKWORM_ROUTES_FILE and swapped atomically on SIGHUP.
  • Target: a validated destination backend address in host:port or [ipv6]:port format (Target in src/routes.rs) that receives the replayed Handshake bytes and the spliced TCP stream.
  • Handshake: the first serverbound packet (0x00) of every modern Minecraft Java Edition TCP connection, carrying protocol version, Server Address, port, and intent (status, login, or transfer).
  • Host field: the UTF-8 Server Address string inside the Handshake packet, parsed by HostField::parse (src/domain.rs) to strip Forge \0 suffixes, decode 26.4 query parameters, and derive the lookup domain.
  • Origin: the original domain (and optional port) carried in the _o query parameter of the Handshake host field, defined for Minecraft 26.4 clients that connect through an SRV record.
  • Static route: a route declared in the JSON file at SCULKWORM_ROUTES_FILE. Read-only through the API, and it wins over a dynamic route for the same hostname.
  • Dynamic route: a route created through the admin API, persisted in SCULKWORM_STATE_FILE and kept across restarts and SIGHUP reloads.
  • Tenant: a service that uses the shared relay, defined in SCULKWORM_TENANTS_FILE with a bearer key, one or more domain scopes, a max_routes cap, and optional allowed_targets. A tenant can only see and change dynamic routes inside its own scopes.
  • Domain scope: a domain a tenant owns. It covers the domain itself and every subdomain of it, and no two tenants may overlap.
  • Closed route: a dynamic route (mode: "closed") with no backend target. Only players admitted by its authorizer reach it, through sculkworm-connect and the route's sculkworm-agent. See Closed routes.
  • Agent: sculkworm-agent (or sculkworm agent). Runs next to a Minecraft server that listens on 127.0.0.1 only, dials out to the relay over TLS with the route's agent token, and serves player streams to the local server.
  • Connect: sculkworm-connect (or sculkworm connect), the player CLI. Logs the player in through the browser (or RFC 8628 device flow), opens a local listener for Minecraft, optionally updates servers.dat (--add-server), and carries each connection to the relay with a ticket.
  • Authorizer: the per-route rule of a closed route that decides which identities may play: fixed-list, oidc (including allow.sculk_server for sculk.network), or oauth2 (with a Discord preset).
  • Ticket: a 30-second, single-use swt_ credential the relay mints after re-checking the player's permission with the identity provider. It opens one connect session on one route.