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, theroutes.jsonfile 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
sculkwormclient 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),SIGHUPreloads, 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.playon a sculk.network server using sculk.network's OIDC provider. - Real-client verification: automated
minecraft-protocoloffline/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-vtags.
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.jsonmapping one normalized domain name to one backend target. - Route table: the in-memory
HashMap<Domain, Target>(RouteTableinsrc/routes.rs) loaded fromSCULKWORM_ROUTES_FILEand swapped atomically onSIGHUP. - Target: a validated destination backend address in
host:portor[ipv6]:portformat (Targetinsrc/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, ortransfer). - Host field: the UTF-8 Server Address string inside the Handshake packet, parsed by
HostField::parse(src/domain.rs) to strip Forge\0suffixes, decode 26.4 query parameters, and derive the lookup domain. - Origin: the original domain (and optional port) carried in the
_oquery parameter of the Handshake host field, defined for Minecraft 26.4 clients that connect through anSRVrecord. - 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_FILEand kept across restarts andSIGHUPreloads. - Tenant: a service that uses the shared relay, defined in
SCULKWORM_TENANTS_FILEwith a bearer key, one or more domain scopes, amax_routescap, and optionalallowed_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 backendtarget. Only players admitted by its authorizer reach it, throughsculkworm-connectand the route'ssculkworm-agent. See Closed routes. - Agent:
sculkworm-agent(orsculkworm agent). Runs next to a Minecraft server that listens on127.0.0.1only, dials out to the relay over TLS with the route's agent token, and serves player streams to the local server. - Connect:
sculkworm-connect(orsculkworm connect), the player CLI. Logs the player in through the browser (or RFC 8628 device flow), opens a local listener for Minecraft, optionally updatesservers.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(includingallow.sculk_serverfor sculk.network), oroauth2(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.