@rebornix/stdio-to-ws
v0.2.0
Published
Bridge stdio processes to WebSocket connections
Maintainers
Readme
stdio-to-ws
Redirect stdio to WebSocket.
Usage
npx stdio-to-ws "stdio command" --port 3000Example:
npx stdio-to-ws "npx @google/gemini-cli --experimental-acp" --port 3000Options
-p, --port <port> Port to listen on (default: 3000)
--persist Keep child process alive during disconnections
-g, --grace-period <seconds> Time in seconds before killing disconnected process (default: 30, -1 for infinite)
-q, --quiet Suppress logging output
-h, --help Show help messagePersistence Mode
Use --persist to keep the child process alive during brief disconnections (e.g., iOS app backgrounding):
npx stdio-to-ws --persist "python my-script.py"When enabled:
- Server sends
{"type": "connected", "clientId": "..."}on new connection - Client saves the
clientIdand sends it viaX-Client-Idheader on reconnect - Messages are buffered during disconnection and replayed on reconnect
License
Apache 2.0
