Developers
Registry protocol
The small HTTP protocol behind the http backend, for writing your own registry.
The http backend talks to any server that speaks this protocol. The
Cloudflare registry is one; you can write your own on any
platform.
Every request carries Authorization: Bearer <token>, the http.token from
link.json. Paths are relative to http.url.
Requests
| Request | Response |
|---|---|
GET /v1/secret | {"secret": "..."}. Create the secret on the first call and return the same one every time after. |
PUT /v1/servers/{id} | The server as JSON, see below. Returns {"servers": [...]}: the live network, including the caller. |
DELETE /v1/servers/{id} | 204. Sent when a server shuts down cleanly. |
Any status of 300 or higher counts as a failure. Link times out after 5 seconds.
The server object
{
"id": "sw-1",
"group": "skywars",
"host": "play.example.com",
"port": 5521,
"players": 2,
"maxPlayers": 12,
"online": [
{ "uuid": "6f1d2c4e-8a3b-4e7f-9c21-5b0a7d3e9f14", "name": "Steve" },
{ "uuid": "0b7c4e2a-1d9f-4c3b-8e6a-2f5d7a9c1e30", "name": "Alex" }
]
}players and maxPlayers are -1 when unknown. online lists who is on the
server; return it unchanged in the list, so /players and /find work. Link
skips entries it can’t read, and treats a missing online as an empty list.
Entries in the returned list may carry a lastSeen field in epoch
milliseconds. Link reads it but doesn’t need it.
Heartbeats
Each server sends its PUT every 10 seconds. The registry must drop a server
that has not sent one for a while; the Cloudflare registry uses 30 seconds.
Use the registry’s own clock for this, not a time sent by the server.
Trust
The secret signs every transfer in the network. Anyone who can read it can admit players to any server, so the registry must refuse requests without the right token, and must only be reached over HTTPS.