jiegec / usbip

A Rust library to run a USB/IP server
MIT License
255 stars 25 forks source link

WebAssembly + WebUSB support #23

Open beriberikix opened 10 months ago

beriberikix commented 10 months ago

Hello! I'm curious if you or anyone is considering porting this to WebAssembly so that it can be combined with WebUSB. I have a project idea where I transport USB/IP over WebSockets to share device from the browser to a web server.

jiegec commented 10 months ago

I believe the core protocol part can be built to WebAssembly, but the rusb/tokio parts may need some porting to allow custom transport.

beriberikix commented 10 months ago

Ah, makes sense. There is a crate for webusb that uses rusb as a backend, but that probably doesn't help here much. https://docs.rs/webusb/latest/webusb/

beriberikix commented 10 months ago

It's also worth noting that libusb, which is what rusb is based on, has an emscripten-based backend that might be useful for anyone else interested in this :)