feat(iroh-relay): connect over a host datagram pipe on wasm32-wasip2 - #2
Open
lann wants to merge 1 commit into
Open
feat(iroh-relay): connect over a host datagram pipe on wasm32-wasip2#2lann wants to merge 1 commit into
lann wants to merge 1 commit into
Conversation
Add a `wasm_wasi` arm to `ClientBuilder::connect`: on wasi components the websocket lives host-side behind a datagram bridge, and the guest reaches it through a synthetic UDP socket at a well-known address. The new `DatagramPipe` carries one websocket message per datagram and implements the `BytesStreamSink` surface, so it replaces `WsBytesFramed` wholesale; subprotocol negotiation happens at the bridge and the in-band challenge-response handshake runs over the pipe, exactly like the browser branch (no TLS keying material export). Part of running iroh on wasm32-wasip2 components (polymorph-components/polymorph-iroh#25).
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.
Adds a
wasm_wasiarm toClientBuilder::connect. On wasi components the websocket lives host-side behind a datagram bridge; the guest reaches it through a synthetic UDP socket at a well-known address (127.0.0.1:1). The newDatagramPipecarries one websocket message per datagram (0x00open/ack with subprotocol negotiation,0x01message,0x02closed) and implements theBytesStreamSinksurface, so it replacesWsBytesFramedwholesale — the in-band challenge-response handshake and the relay protocol codec run over it unchanged. Like the browser branch it exports no TLS keying material, which routes the handshake down the challenge-response path.This is the relay-dialer seam from polymorph-components/polymorph-iroh#25: the piece that lets the unmodified iroh endpoint run relay-only on wasip2 under jco/JSPI (Node and browsers), validated end to end there (connect-through-relay, live migration, stock iroh-blobs transfers, public demo). The bridge protocol is the part most likely to want upstream design discussion — it assumes a host that terminates the websocket and speaks the tagged-datagram framing.
Siblings: the iroh-dns resolver-config fallback and the net_report probe gate. Merged together into the long-lived
polymorph-irohbranch that the component experiments consume.