Documentation
¶
Overview ¶
Example server demonstrates embedding pkg/usbip.Exporter in a custom process: listen on TCP, bind a local device for export, then serve the USB/IP accept loop until SIGINT/SIGTERM.
Usage:
sudo go run ./examples/server ADDR BUSID
ADDR is a bind address (e.g. 0.0.0.0:3240). BUSID is a locally- enumerable bus id (e.g. "1-1.2"). Root (or CAP_SYS_ADMIN + CAP_DAC_OVERRIDE) is required because Bind writes sysfs under /sys/bus/usb/drivers/usb and /sys/bus/usb/drivers/usbip-host — see docs/security.md.
This is the library-embed counterpart to cmd/usbip-go, the production daemon. For systemd socket-activation and resource caps, use the daemon; for a one-shot or custom lifecycle process, start here.
Click to show internal directories.
Click to hide internal directories.