How It Works
There is no server. Every running copy is a peer, and peers find each other by announcing themselves on the local network.
The sequence
Once launched, each client:
- Advertises itself over mDNS under the service type
_sharedclipboard._tcp.local. - Continuously browses for other devices advertising the same service type.
- Opens a WebSocket connection to every peer it discovers.
- Broadcasts new local clipboard content to all connected peers.
- Writes incoming messages from peers into the local clipboard.
Full mesh
Every device connects directly to every other one, rather than through an elected leader:
Device A ↔ Device B
↕ ↕
└── Device C ──┘
The advantage is that no single machine has to stay on for the others to keep working. The cost is that connection count grows with the square of the number of devices, which is irrelevant at the handful of machines this is built for and would matter at fifty.
What travels
Clipboard text. Images, files and rich formatting are not synchronised.
Nothing is stored: a message is written to the receiving clipboard and forgotten. There is no history, no queue, and no state that survives a restart.
What it needs from the network
mDNS is link-local, so every device has to be on the same subnet. A guest network that isolates clients from one another, or a VPN that captures all traffic, will prevent discovery even though both machines have internet access.