websocat is a command-line client for WebSockets that provides netcat and curl-like functionality for ws:// connections with advanced socat-inspired features.
The tool addresses the need for interactive WebSocket communication from the command line, similar to how netcat and curl work for TCP and HTTP. It enables users to connect to WebSocket servers, serve WebSocket endpoints, and pipe data between WebSockets and external programs. The approach treats WebSockets as a first-class transport layer accessible through simple command-line invocations, supporting both text and binary modes with automatic conversion between lines or null-terminated records and WebSocket messages.
Developers should choose this tool when they need to debug WebSocket services, integrate WebSocket communication into shell scripts, or quickly test WebSocket endpoints without writing application code. It suits projects requiring WebSocket proxying, integration with existing command-line tools, or bridging between WebSocket and traditional network protocols. The tool works with Nginx integration, SOCKS5 servers, UNIX sockets, and inetd mode, making it flexible for various deployment scenarios. It runs on Linux, Windows, and macOS with pre-built executables available. The README mentions wsbroad as an alternative for scenarios focused specifically on broadcasting messages between WebSocket clients.
The project maintains active development across multiple Rust versions, with an alpha version supporting recent Rust toolchains while stable versions accommodate older compiler versions through legacy dependency management. The codebase includes comprehensive examples covering echo servers, proxying, remote debugging integration, and client broadcasting patterns. The tool provides low-level WebSocket implementation with customizable transport layers, allowing users to wrap connections with external programs for SSL, proxying, or other protocol handling.