jiegec / usbip

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

WebAssembly + WebUSB support #23

Open beriberikix opened 1 year ago

beriberikix commented 1 year 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 1 year 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 1 year 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 1 year 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 :)