Websocat
$ websocat Community Med Riskwebsocat bridges standard input/output to ws:// and wss:// WebSockets, Unix sockets, and local test servers. Agents use -1 (--one-message), -n (--no-close), and --jsonrpc to test WebSocket and CDP endpoints cleanly.
brew install websocat Direct shell bridge for probing WebSocket streams and JSON-RPC endpoints; wrap with timeout or -1 so streams exit cleanly.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Works cleanly in pipes with -1 (--one-message), -t, -0, and --jsonrpc, though open-ended streams will stay open indefinitely without -1 or an external timeout.
- Supports
-1(--one-message),-E(--exit-on-eof), and--jsonrpc
Client-only by default without credential storage; server/exec modes exist if explicitly invoked.
- Transient
-Hheaders with no stored credential files
Compiled Rust binary packaged in Homebrew, Cargo, and Linux repositories.
- Cross-platform binary via
brew,cargo, and GitHub Releases
Fills the WebSocket gap where curl is awkward, with neat --jsonrpc support for CDP.
- Handles
ws://,wss://, JSON-RPC, and null-delimited frames
Established community Rust crate vi/websocat under MIT license.
vi/websocatGitHub repository
Extensive README recipes, though flag combinations can be dense (--help=full).
- Detailed examples in
vi/websocatREADME
Security, Auth & Guardrails
Passes auth headers transiently via -H "Authorization: Bearer ..."; stores no credentials.
Free, MIT open-source Rust binary.
# Websocat Agent Rules - Always pass `-1` (`--one-message`) or wrap with `--ping-interval` / external timeout so persistent WebSocket connections do not hang agent shells. - Avoid `-s` server mode unless intentionally spawning a background test listener.
Agent-Ready Command Recipes
Safe Read-Only Queries
echo '{"op":"ping"}' | websocat -1 wss://echo.websocket.events Sends one JSON line, prints the single response (-1), and closes without hanging.
Controlled Writes & Previews
echo 'Runtime.evaluate {"expression":"1+1"}' | websocat -1 --jsonrpc ws://127.0.0.1:9222/devtools/page/ID Wraps stdin into a JSON-RPC 2.0 frame (--jsonrpc) and exits after receiving one reply (-1).
Strengths for Agents
- +
-1(--one-message) makes request/reply WebSocket checks safe and non-blocking. - +
--jsonrpcstreamlines debugging Chrome DevTools Protocol and JSON-RPC sockets.
Caveats & Pitfalls
- ! Without
-1or an external timeout,websocatstays connected until the server closes. - ! Advanced specifier syntax (
ws-u:,autoreconnect:) has a learning curve.