Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

socat

$ socat Community High Risk
dest-unreach · Browser & Web · GPL-2.0 · macos / linux

socat is a versatile multi-protocol relay transferring bidirectional byte streams between two independent address specifications (socat TCP-LISTEN:8080,fork TCP:host:80). Indispensable for bridging UNIX domain sockets (/var/run/docker.sock), OpenSSL/TLS endpoints, and virtual PTYs, though EXEC:/SYSTEM: addresses and wildcard binds require strict guardrails.

FCRS-1.0 Score
73 /100
Usable w/ Caveats
Medium Confidence
Zero-Friction Install
brew install socat
CLI vs MCP Decision CLI Only

Bridges local UNIX sockets, TCP/TLS sockets, and stdio streams directly (socat - UNIX-CONNECT:...); MCP servers cannot relay arbitrary socket types.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 16 / 25

Deterministic non-interactive CLI with -T timeouts and clean exit codes, though the comma-separated address DSL is dense and has no JSON output.

  • Non-interactive stdio/socket bridging with -T idle timeouts
  • Dense address DSL and plain-text diagnostics
Trust & Safety 14 / 25

Supports EXEC:/SYSTEM: shell execution over sockets and binds 0.0.0.0 by default on TCP-LISTEN unless bind=127.0.0.1 is explicitly added.

  • EXEC:/SYSTEM: address types can expose shells over sockets
  • Requires explicit bind=127.0.0.1 on listeners
Setup & Portability 13 / 15

Standard package on macOS (brew install socat) and nearly every Linux distribution.

  • Available via Homebrew and Linux package managers
Utility & Efficiency 14 / 15

Unmatched Swiss-army relay for UNIX sockets, TLS wrapping (OPENSSL:), SOCKS4A, PTYs, and pipes.

  • Bridges UNIX sockets, TLS, TCP, UDP, PTY, and stdio
Maintenance & Lineage 8 / 10

Long-maintained dest-unreach project (socat 1.8.x) under GPL-2.0.

  • Active 1.8.x releases at dest-unreach.org/socat
Docs & Verifiability 8 / 10

Exhaustive socat(1) manual page and built-in socat -h / socat -hh reference.

  • Official HTML manual and socat -hh option listing

Security, Auth & Guardrails

Auth Modes
No Auth Config File
Credential Storage

No central config store; optional TLS keys, CA certs, or proxy credentials are passed inline as address parameters.

Side Effects
Read-Only Local Write Remote Write
Cost & Quotas

Free, GPL-2.0 open-source C utility.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# socat Agent Rules
- Always include `bind=127.0.0.1` on `TCP-LISTEN` and `-T <seconds>` for one-shot stdio calls so processes do not hang or expose ports publicly.
- Never attach `EXEC:` or `SYSTEM:` to network-listening `socat` addresses.

Agent-Ready Command Recipes

Safe Read-Only Queries

Inspect socat version and compiled address types
socat -V

Prints version, OpenSSL/readline build support, and exits without opening sockets.

Query a local UNIX domain socket via stdio
printf 'PING\r\n' | socat -T 2 - UNIX-CONNECT:/tmp/app.sock

Sends a command to /tmp/app.sock from stdin and closes after a 2-second inactivity timeout (-T 2).

Controlled Writes & Previews

Forward localhost TCP port to a UNIX socket
socat TCP-LISTEN:8080,bind=127.0.0.1,reuseaddr,fork UNIX-CONNECT:/tmp/app.sock

Bridges local 127.0.0.1:8080 to /tmp/app.sock cleanly without exposing 0.0.0.0.

Strengths for Agents

  • + Bridges UNIX domain sockets, OpenSSL TLS, TCP, UDP, and stdio cleanly in one command.
  • + -T <secs> timeout prevents indefinite hangs on one-shot stdin/stdout socket queries.

Caveats & Pitfalls

  • ! Combining TCP-LISTEN with EXEC:/SYSTEM: or omitting bind=127.0.0.1 creates severe exposure risks.
  • ! Address-option grammar is terse and error messages require -d -d for debugging.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI