Repository navigation
feat: pass connection signals between a listed host and a joining player - #17
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
"rendezvous": truein its signed advertisement, and gets a secret token for its session with the answer.POST /v1/rendezvous/offer,sendandpoll: 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.rendezvous, and--no-rendezvousturns it off."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.Bounds
Checked
Unit tests for the mailboxes, the token and the allowances.
check-directory.pyruns 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.