Relay
The relay is the peer that is always on. Your devices and VMs come and go, so changes need somewhere to wait for the device that has not seen them yet. The relay holds a copy of everything it has been sent and passes it on to whoever connects.
How it works
The relay runs Subduction, Ink & Switch's open-source sync server, over WebSocket. Devices connect to it, send the changes it is missing, and receive the changes they are missing. It stores documents, session logs and the git objects your sessions work on, all encrypted end to end, so it holds only ciphertext and serves each peer only what its grants allow (see encryption).
The relay is a peer, not a server of record. It has no authority over your data and makes no decisions about it: it holds the same CRDTs every other peer holds, so if it is unreachable, your devices keep working and catch up with it later. A device that cannot reach the relay keeps serving its own window locally and retries with growing gaps.
Each device has its own key and signs its connection to the relay with it.
Mod runs a relay for you. It is the open-source Subduction reference server, so the protocol it speaks is open too.
Using it as you build
You do not talk to the relay directly. Peers sync through it on their own, and anything you write through Mod's tools reaches it the same way. When you debug sync, compare what a fresh peer reads back with what you wrote: that is the only proof the relay holds a change.
Limits
- The relay cannot yet pass a request through to a device, such as a phone reading a VM's live state. soon
- Pointing Mod at a relay you run yourself is not a supported setting yet. soon