junkpile

09 · Tauri v1 Feedback WebSocket

A modernized two-window Tauri v1 example demonstrating webcam-driven raw WebGL feedback over an embedded Rust WebSocket relay.

What it demonstrates

Signal flow

controls.html
    ↓ parameter/state messages
Rust WebSocket relay
    ↓
canvas.html
    ↓
source texture → simulation shader → history A/B → display shader → output

The output window owns both getUserMedia() and WebGL. A MediaStream is not transferred between Tauri WebViews.

Run

npm install
npm run dev

Production build

npm run build

On macOS, bundles are created below:

src-tauri/target/release/bundle/

Unsigned local builds may be blocked by Gatekeeper when moved to another machine. Public distribution requires signing and notarization.

Controls

Keyboard shortcuts

Architecture notes

The controls coalesce slider changes into at most one WebSocket batch per animation frame. On connection, the output requests a full state snapshot. This restores parameters, pause state, camera request, and history resolution after reloads or reconnects.

The Rust relay remains renderer-agnostic: text messages are broadcast to other clients, while binary messages are routed to the canvas role.

Known limitations