# websockets/wscat

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/websockets-wscat).**

2,675 stars · 249 forks · JavaScript · mit

## Links

- GitHub: https://github.com/websockets/wscat
- awesome-repositories: https://awesome-repositories.com/repository/websockets-wscat.md

## Description

wscat is a command-line WebSocket client and server tool that provides an interactive terminal interface for connecting to WebSocket endpoints, sending and receiving text messages in real time, and managing WebSocket control frames through typed slash commands. It supports basic HTTP authentication by injecting credentials into the initial WebSocket handshake request, and can route connections through an HTTP proxy using the CONNECT tunneling method.

The tool includes a built-in WebSocket server mode that listens on a specified port, accepts incoming client connections, and relays messages between connected clients. It also supports automated command execution, allowing predefined commands to run automatically after a WebSocket connection is established. The event-driven message loop handles incoming WebSocket frames and user commands asynchronously, while slash commands map directly to WebSocket control frames for ping, pong, and close operations.

The project provides a collection of WebSocket client implementations, including a basic auth client, a CLI client, a control frame sender, and a proxy client, all accessible through a single command-line interface. The documentation covers installation and usage for both client and server modes.

## Tags

### Graphics & Multimedia

- [Terminal Interaction](https://awesome-repositories.com/f/graphics-multimedia/immersive-interactive-systems/user-interaction/terminal-interaction.md) — Provides an interactive terminal interface for sending and receiving WebSocket messages in real time.

### Networking & Communication

- [Real-time Messaging](https://awesome-repositories.com/f/networking-communication/communication-platforms-services/communication-platforms/real-time-collaboration-suites/real-time-messaging.md) — Transmits typed text lines to the connected server and displays incoming messages in real time. ([source](https://github.com/websockets/wscat#readme))
- [WebSocket Clients and Servers](https://awesome-repositories.com/f/networking-communication/distributed-systems-p2p/distributed-computing/communication-protocols/websocket-implementations/websocket-clients-and-servers.md) — Provides a built-in WebSocket server that accepts connections and relays messages between clients.
- [Port-Based WebSocket Listeners](https://awesome-repositories.com/f/networking-communication/distributed-systems-p2p/distributed-computing/communication-protocols/websocket-implementations/websocket-clients-and-servers/port-based-websocket-listeners.md) — Starts a local WebSocket server on a specified port to accept incoming client connections. ([source](https://github.com/websockets/wscat#readme))
- [WebSocket Clients](https://awesome-repositories.com/f/networking-communication/websocket-clients.md) — Provides a command-line tool for connecting to WebSocket servers and exchanging messages interactively.
- [WebSocket Control Frame Senders](https://awesome-repositories.com/f/networking-communication/connection-control-frame-handlers/websocket-control-frame-senders.md) — Sends WebSocket control frames such as ping, pong, and close via slash commands.
- [WebSocket Proxy Routings](https://awesome-repositories.com/f/networking-communication/network-infrastructure-routing/network-infrastructure-configuration/network-management/dns-connectivity-management/network-connectivity-configurations/proxy-connection-sharing/proxy-connection-configurations/websocket-proxy-routings.md) — Forces WebSocket connections through an HTTP proxy that supports the CONNECT method. ([source](https://github.com/websockets/wscat#readme))
- [WebSocket CONNECT Tunnels](https://awesome-repositories.com/f/networking-communication/network-infrastructure-routing/network-proxying-tools/network-proxies/udp-tunneling/http-tunnels/websocket-connect-tunnels.md) — Routes WebSocket connections through an HTTP proxy using the CONNECT tunneling method.
- [Authenticated](https://awesome-repositories.com/f/networking-communication/websocket-clients/authenticated.md) — Attaches basic HTTP authentication credentials to the WebSocket handshake request for credential-based access.
- [Proxy-Routed](https://awesome-repositories.com/f/networking-communication/websocket-clients/proxy-routed.md) — Routes WebSocket connections through an HTTP proxy supporting the CONNECT method.

### Security & Cryptography

- [WebSocket Handshake Authentications](https://awesome-repositories.com/f/security-cryptography/basic-authentication/websocket-handshake-authentications.md) — Attaches basic HTTP authentication headers to the initial WebSocket handshake request for credential-based access. ([source](https://github.com/websockets/wscat#readme))
- [WebSocket Handshake Injections](https://awesome-repositories.com/f/security-cryptography/basic-authentication/websocket-handshake-injections.md) — Injects Basic HTTP authentication headers into the initial WebSocket upgrade request for credential-based access.

### Development Tools & Productivity

- [WebSocket Control Frame Commands](https://awesome-repositories.com/f/development-tools-productivity/slash-command-interfaces/websocket-control-frame-commands.md) — Maps typed slash commands directly to WebSocket control frames for ping, pong, and close operations.

### Software Engineering & Architecture

- [Event-Driven Architectures](https://awesome-repositories.com/f/software-engineering-architecture/event-driven-architectures.md) — Uses an event-driven architecture to handle incoming WebSocket frames and user commands asynchronously.
