Registry / devops / interactive-websocket-cli

interactive-websocket-cli

JSON →
library1.5.0jsnpmunverified

Interactive WebSocket CLI (iwscli) v1.5.0 is an interactive command-line tool for debugging and testing WebSocket connections. It provides an interactive client (`wscli connect`) and server (`wscli listen`), as well as a proxy tool (`wstee`) for monitoring WebSocket traffic. Key differentiators include interactive keypress-driven commands for sending messages (client) and managing multiple clients (server), pipe mode for stdin/stdout integration, support for file-based input/output, and configurable WebSocket options via JSON. Released March 2023, with a steady cadence of minor updates. Commonly used in development workflows for manually testing WebSocket endpoints or proxying traffic.

npm install interactive-websocket-cli
INSTALL
IMPORT
SIG · INTERACTIVE-WEBSOC
I
interactive-websocket-cli
devopsjavascriptv1.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

N/A (CLI tool)
npx interactive-websocket-cli
require('interactive-websocket-cli')
This package is a CLI tool, not a library. Install globally with npm i -g interactive-websocket-cli, then use via wscli or wstee commands.
wscli
wscli connect ws://example.com
wscli connect http://example.com
Address must be a WebSocket URL (ws:// or wss://) or a shorthand like 'echo.websocket.org' (auto-prefixed with ws://).
wstee
wstee
wstee --help incorrectly
wstee is a separate binary for proxying, usage: wstee --help for options.

Shows how to install and use wscli to connect to a WebSocket server, start a server, and use wstee for proxying.

# Install globally npm i -g interactive-websocket-cli # Connect to a public echo server wscli connect wss://echo.websocket.org # Once connected, press 'h' for help, 's' to send a message, type message and press Enter # Start a local WebSocket server on port 8080 wscli listen 8080 # In another terminal, connect: wscli connect ws://localhost:8080 # On server: press 'b' to broadcast a message to all clients # Use wstee to proxy a connection and monitor traffic wstee --proxy-url wss://echo.websocket.org --listen-port 3000 # Then connect to ws://localhost:3000; all traffic is logged and forwarded
Debug
Known issues
gotchaThe connect command automatically prefixes ws:// if no scheme is given, which may lead to unintended unsecured connections.
fix
Always specify the full URL (ws:// or wss://) when connecting to avoid automatic prefix.
affects: *
gotchaThe -p (pipe) option must be enabled when using --in file inputs, otherwise files are ignored.
fix
Add -p flag when using --in: wscli connect -p --in messages.txt ws://example.com
affects: *
deprecatedwstee proxy command no longer supports config file options in newer releases; use CLI flags instead.
fix
Upgrade to v1.5.0+ and use CLI flags (--proxy-url, --listen-port) instead of config files.
affects: <1.5.0
gotchaWhen running as server, the 't' (transmit) command requires selecting clients first via 's' (select prompt).
fix
Press 's', enter client numbers (e.g., 1,2), then press 't' and type message.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'commander'
Missing dependency or global install failure
fix
Run npm i -g interactive-websocket-cli to install all dependencies globally.
wscli: command not found
Package not installed globally or not in PATH
fix
Install globally: npm i -g interactive-websocket-cli. Ensure global node_modules bin is in PATH.
TypeError: Cannot read properties of undefined (reading 'on')
Using wscli without specifying a command (connect/listen)
fix
Use wscli connect <url> or wscli listen <port>.
Error: Invalid URL: ws://localhost:9000/extra
URL path is not supported; connect command expects only host:port
fix
Use ws://localhost:9000 without path.
Upgrade
Version history
1.5.0latest on npm
Audit
Dependencies
wsrequiredCore WebSocket library for client and server functionality
commanderrequiredCLI argument parsing
chalkrequiredTerminal string coloring for pretty output
Agent activity
15 hits · last 30 days
node
14
Resources
interactive-websocket-cli — npm install interactive-websocket-cli · libregistry