This is a POC I created back in 2020. It's an app that allows users to share files P2P in-browser via WebRTC.
See Past Rust Experiments: Positivelys & Shared Spaces for more details
- Figure out how to make an app with Rust and WASM
- Use "HTTP Requests" across boundaries
- Send data across the FFI between JavaScript and WASM. This allowed for familiar server-side pattern between the browser and the WASM app. The WASM app returns HTML responses and the browser JS code updates the DOM
- Send "HTTP Requests" across the WebRTC connection. Again, this allowed for a familiar server-side pattern. Each WebRTC client asks like independent server where they can make HTTP requests to each other.
- A basic BitTorrent implementation for file sharing where files are split into parts, ordered, hashed, and sent across the WebRTC connection to be reconstructed
cargo watch -s 'wasm-pack build --target web --scope logankeenan' -i pkg