webmuxd
is a WebUSB implementation of Apple's usbmuxd
protocol, compatible with libimobiledevice/usbmuxd.
Yarn:
yarn add webmuxd
NPM:
npm add webmuxd
In this repo you will find webmuxd.ts
. This is a node module that provides the client side implementation of
connecting to the WebUSB API surface and configuring the message pump. You can see a more complete example and
implementation of this by looking at webmuxd-example and it's
corresponding server component go-webmuxd. The example connects up this
component to a WebSocket and pipes the USB content back and forth to the go-webmuxd
server, which finally passes
it to libimobiledevice
via a UNIX socket on disk.
If you wish to create your own build it's rather simple:
yarn run build
The simplest way to build, develop and diagnose is using the XHC20
USB capture on macOS, and optionally demuxusb
https://www.umpah.net/how-to-sniff-usb-traffic-reverse-engineer-usb-device-interactions/
Using a Chromebook as an endpoint:
https://blog.rickmark.me/puppeteer-with-chromeos/
This project is happy to accept PRs and other contributions. It is free for commercial use under the MIT license, I would love to see it credited if so!
To make this component "production ready" and less of a proof of concept the following should be completed:
- Handle all
usbmuxd
framing, and ACKs in script to reduce RTT (round trip time) - Create a standardized WebSocket protocol and move it from
webmuxd-example
towebmuxd
keeping only the UI- Move
MobileDevice.ts
- Move
RemoteChannel.ts
- Move
transport.proto
/transport.ts
- Move
- Factor out "common UI elements" to
webmuxd-ui
- Device Picker
- Device Info
- Improve
go-webmuxd
as a multi-session "meet me" service