Skip to content

feat: pass connection signals between a listed host and a joining player - #17

Merged
vdmkenny merged 2 commits into
mainfrom
feat/rendezvous
Nov 22, 2026
Merged

vdmkenny merged 2 commits into
mainfrom
feat/rendezvous

Conversation

@vdmkenny

@vdmkenny vdmkenny commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Rendezvous, so a game hosted behind a home router can be joined without a forwarded port. The design is on OpenReliant/openreliant#363.

What it adds

  • A host asks for rendezvous with "rendezvous": true in its signed advertisement, and gets a secret token for its session with the answer.
  • POST /v1/rendezvous/offer, send and poll: a joining player opens an exchange with a listing and gets a secret id. Both sides then send and poll signals, the host with its token and the player with the id.
  • The capabilities endpoint reports rendezvous, and --no-rendezvous turns it off.
  • A host can also send "unlisted": true. It is then left out of every list and is reached only with its key and session, which the host hands out as an invite. The session is new for each hosted game, so an invite ends with the game.
  • The directory stores and hands over the signals. It doesn't read them and never dials anything. The game's own connection still checks the host's key from the listing, so a directory that altered signals could stop a connection but not stand in for the host.

Bounds

  • Signals of up to 2880 bytes, eight waiting each way, in at most 64 exchanges: about 3 MB, allocated once.
  • An exchange lives 60 seconds and ends after 30 without activity.
  • One source holds four open exchanges and makes twelve offers a minute.
  • A listing at its eight exchanges gives up its oldest, and so does a full table. Offers nobody follows up therefore keep no player out, where a hard cap would let two addresses block every join to a host.
  • Rendezvous requests have an allowance of their own (600 a minute for a source), so polling doesn't use up the one browsing and publishing share.
  • Tokens are compared in constant time. They end with the lease, a withdrawal, a new session of the same host, and when the host stops asking, and the session's exchanges close with them.

Checked

Unit tests for the mailboxes, the token and the allowances. check-directory.py runs a whole exchange and then tries to misuse it: wrong, malformed and other hosts' tokens, unknown ids, reading another host's exchange, oversized, empty and non-base64 signals, unknown fields, an oversized body, a full mailbox, more exchanges and offers than one source may have, pushing a listing past its share, running out the polling allowance while browsing still works, and using a token and an exchange after the session ended.

Left

Merging this publishes a release. The game only sends the new field to an instance that reports the capability, so older instances keep working with newer games.

A host behind a home router can't be reached at its listed address. With
rendezvous the directory hands the two games' connection signals to each
other through bounded mailboxes they poll, and they then connect directly.
The directory doesn't read the signals and never dials anything.
An unlisted game is left out of every browse answer and is reached only with
its key and session, which the host hands out as an invite.
@vdmkenny
vdmkenny merged commit 653ca20 into main Nov 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant