Skip to content

feat(example): stream peer-hosted audio and images over httpi:// - #265

Merged
momics merged 3 commits into
mainfrom
feat/tauri-example-audio-streaming
Jun 28, 2026
Merged

feat(example): stream peer-hosted audio and images over httpi://#265
momics merged 3 commits into
mainfrom
feat/tauri-example-audio-streaming

Conversation

@momics

@momics momics commented Jun 27, 2026

Copy link
Copy Markdown
Owner

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)

  • Add a host task that wires @std/http's serveDir over node.serve to host ./public over httpi:// — a vanilla file server, no custom HTTP code (per ADR-013, lean on the ecosystem).
  • Ship procedurally generated, public-domain audio.wav (WAVE PCM 16-bit mono 44.1 kHz) and image.png (256×256 RGBA).
  • Grant --allow-sys=inspector on all tasks (the FFI init requires it).

Tauri (client)

  • 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 host node ID.
  • Widen the CSP to allow httpi: / http://httpi.localhost media and images.

Notes

Testing

  • Verified end-to-end locally: deno task host serves /audio.wav + /image.png; the Tauri Stream files tab plays the audio and renders the image after pasting the host's node ID.
  • cargo check passes for the example; npm run tauri dev launches; deno check main.ts clean; example main.ts has no TS errors.

momics added 3 commits June 27, 2026 20:37
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.
@momics
momics merged commit 7501658 into main Jun 28, 2026
6 checks passed
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