Skip to content

feat: direct local-network transport (WebRTC, no signaling server) - #51

Merged
Mathieu2301 merged 1 commit into
mainfrom
nox/direct-transport
Nov 15, 2026
Merged

Mathieu2301 merged 1 commit into
mainfrom
nox/direct-transport

Conversation

@Mathieu2301

Copy link
Copy Markdown
Member

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.

  • Coordinator: direct option (on by default when node-datachannel is installed), persistent DTLS identity in .miakapp/direct, user side of RFC 0001 for its own declarations, local tickets issued through miakapp.direct.<name>, offline state.set replayed to the relay.
  • Browser client: direct store option, race direct ↔ relay, transport getter, probe to switch back to direct.
  • Proven in Chrome 156 (cloud browser) from https://www.miakapp.com to a test coordinator; end-to-end offline test in test/direct.test.ts.
  • miakapi 4.1.0.

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.
@Mathieu2301
Mathieu2301 merged commit 0fcb844 into main Nov 15, 2026
1 check passed
@Mathieu2301
Mathieu2301 deleted the nox/direct-transport branch November 15, 2026 02:51
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