server

command
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL