Repository navigation
feat: direct local-network transport (WebRTC, no signaling server) - #51
Merged
Merged
Conversation
The coordinator listens for residents on one UDP port through WebRTC and speaks the user side of RFC 0001 for itself, with its own declarations as authorization. The browser builds the whole exchange from cached coordinates (addresses, port, DTLS fingerprint, ICE password): no signaling server and no local SDP munging. Residents get the coordinates and a coordinator-signed local ticket through the relay (miakapp.direct.<name>), so a session opens without the cloud. The browser client races a direct session against the relay when it has coordinates for the home, keeps the first ready, and switches back to direct when the home becomes reachable again. Without the relay, coordinator state.set applies locally and is replayed on reconnection. node-datachannel is an optional dependency; direct: false turns it off.
This was referenced Nov 15, 2026
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.
Residents reach the coordinator over the LAN with a WebRTC DataChannel opened from cached coordinates, without a signaling server, and keep using the home when the internet is down.
directoption (on by default whennode-datachannelis installed), persistent DTLS identity in.miakapp/direct, user side of RFC 0001 for its own declarations, local tickets issued throughmiakapp.direct.<name>, offlinestate.setreplayed to the relay.directstore option, race direct ↔ relay,transportgetter, probe to switch back to direct.test/direct.test.ts.