feat(example): stream peer-hosted audio and images over httpi:// - #265
Merged
Conversation
Showcase a cross-runtime flow: the Deno example hosts a directory of files, and the Tauri example streams them straight into native media elements through the httpi:// scheme handler. Deno: - add `host` task wiring @std/http serveDir over node.serve to host ./public over httpi:// (vanilla file server, no custom HTTP code) - ship procedurally generated, public-domain audio.wav and image.png - grant --allow-sys=inspector on all tasks (FFI init requires it) Tauri: - enable the httpi:// scheme via builder().with_scheme() - replace the Audio tab with a "Stream files" tab that loads peer-hosted audio (<audio>, with Range seeking) and images (<img>) by node ID - widen CSP to allow httpi:/http://httpi.localhost media and images The previous self-served WAV demo is removed: iroh blocks self-dialing ("Connecting to ourself is not supported"), tracked in #264.
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.
Summary
Showcase a cross-runtime flow where the Deno example hosts a directory of files and the Tauri example streams them straight into native media elements through the
httpi://scheme handler — no IPC bridging, no base64.Deno (host)
hosttask that wires@std/http'sserveDirovernode.serveto host./publicoverhttpi://— a vanilla file server, no custom HTTP code (per ADR-013, lean on the ecosystem).audio.wav(WAVE PCM 16-bit mono 44.1 kHz) andimage.png(256×256 RGBA).--allow-sys=inspectoron all tasks (the FFI init requires it).Tauri (client)
httpi://scheme viabuilder().with_scheme().<audio>, withRangeseeking) and images (<img>) by host node ID.httpi:/http://httpi.localhostmedia and images.Notes
Connecting to ourself is not supported), tracked in Support self-requests (a node fetching its own node ID) via in-process loopback #264.Testing
deno task hostserves/audio.wav+/image.png; the Tauri Stream files tab plays the audio and renders the image after pasting the host's node ID.cargo checkpasses for the example;npm run tauri devlaunches;deno check main.tsclean; examplemain.tshas no TS errors.