@0xlimo/host reference
How x1-host (@0xlimo/host 0.1.2) sandboxes a game server, with its containers, forwarders, limits, the endpoints it serves and how it handles paid games.
The package has no typings. It exports the binary x1-host <config.json>, whose module is
src/runner.js (startRunner(cfg)). This page describes what a developer's server sees.
Operating an instance is not covered.
#Containers per app
| Container | Role |
|---|---|
x1s-<app> (sidecar) | owns the network namespace (--network none, loopback only). It bridges three unix sockets to loopback: players to 127.0.0.1:8080, 127.0.0.1:7801 to the broadcast service, and 127.0.0.1:7802 to the platform API. |
x1g-<app> (your game) | joins the sidecar's namespace and runs node <entry> as uid 10001 under tini. It has a read-only root and app, --cap-drop ALL, no-new-privileges, CPU, memory and pids quotas, and a /tmp tmpfs. |
| build (throwaway) | unpacks the bundle and runs npm ci --ignore-scripts. It has network access for the registry, but runs no package scripts. |
The image is node:24-bookworm-slim.
#Constants (src/sandbox.js)
| Name | Value |
|---|---|
PORT | 8080 |
BCAST_PORT | 7801 |
API_PORT | 7802 |
LIMITS.cpus | 1 |
LIMITS.memoryMb | 512 |
LIMITS.pids | 128 |
LIMITS.tmpMb | 64 |
LIMITS.logMb | 5 (2 files) |
LIMITS.nofile | 4096 |
LIMITS.bundleMb | 50 |
LIMITS.installedMb | 400 |
LIMITS.servers | 2 per developer |
LIMITS.total | 20 |
#Names
- App names match
^[a-z0-9][a-z0-9-]{1,40}$. - Entry files match
^[A-Za-z0-9_][A-Za-z0-9_./-]{0,120}\.(m?js|cjs)$. The default isserver.mjs.
#Endpoints served
| Path | Who | Notes |
|---|---|---|
/x1/game/<app>/… (HTTP and WebSocket upgrades) | players | forwarded to the sandbox as /… with X-Forwarded-Prefix; ?x1_play= is removed before the request reaches the game; the front drops any Set-Cookie with a Domain |
/x1/host/v1/servers[/<app>[/logs|/stop|/start]] | developers (Bearer: 0x developer token) | see @0xlimo/host |
/x1/host/v1/public/servers/<app> | anyone | {app, url, state, release, since} |
/healthz | the runner | {ok, apps} |
#Paid games
When the runner is configured with a paygate ("paygate": {"url", "markerDir"}), every
/x1/game/<app>/ request for a paid site is checked by x1-paygate. It
passes with the x1_pass cookie, scoped to Path=/x1/game/<app>/, or with
?x1_play=<play ticket>. Free games' answers and owners' passes are cached for 30 s. The 0x.limo
runner has no paygate configured.
