{"id":49775,"library":"wscat","title":"wscat","description":"wscat is a command-line WebSocket client and server, enabling interactive communication with WebSocket endpoints. Current stable version is 6.1.0, released irregularly as part of the websockets ecosystem. It supports both connecting to servers and listening for connections, with features like authentication, SSL/TLS, proxy support, and slash commands for control frames. Unlike browser-based WebSocket tools, wscat is lightweight and runs directly in the terminal with Node.js. Appropriate for testing, debugging, and scripting WebSocket interactions.","status":"active","version":"6.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/websockets/wscat","tags":["javascript","wscat","websocket","cat"],"install":[{"cmd":"npm install wscat","lang":"bash","label":"npm"},{"cmd":"yarn add wscat","lang":"bash","label":"yarn"},{"cmd":"pnpm add wscat","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"command-line argument parsing","package":"commander","optional":false},{"reason":"WebSocket implementation","package":"ws","optional":false}],"imports":[{"note":"wscat is a CLI tool, not a library; use npx or global install.","wrong":"npm install wscat && node -e 'require(\"wscat\")'","symbol":"wscat CLI","correct":"npx wscat -c ws://example.com"},{"note":"Package exports a function, but it's not documented for programmatic use.","wrong":"const wscat = require('wscat')","symbol":"programmatic usage","correct":"import { wscat } from 'wscat'"}],"quickstart":{"code":"# Global install\nnpm install -g wscat\n\n# Connect to a WebSocket server\nwscat -c wss://echo.websocket.org\n\n# Listen on port 8080\nwscat -l 8080\n\n# Connect with authentication\nwscat -c wss://example.com --auth username:password","lang":"javascript","description":"Install wscat globally and demonstrate connect and listen modes with authentication."},"warnings":[{"fix":"Upgrade Node to version 18 or later.","message":"wscat v6 drops support for Node <18","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Use as CLI only. For programmatic WebSocket use the 'ws' package directly.","message":"wscat is not a library; do not import programmatically","severity":"gotcha","affected_versions":">=5.0.0"},{"fix":"Use --subprotocol instead.","message":"Use of --protocol flag is deprecated","severity":"deprecated","affected_versions":">=6.0.0"}],"env_vars":null,"search_vec":"'6.1.0':22 'appropri':71 'authent':44 'base':57 'browser':56 'browser-bas':55 'cat':82 'client':9 'command':6,50 'command-lin':5 'communic':14 'connect':34,40 'control':52 'current':18 'debug':74 'direct':65 'ecosystem':30 'enabl':12 'endpoint':17 'featur':42 'frame':53 'interact':13,78 'irregular':24 'javascript':79 'lightweight':62 'like':43 'line':7 'listen':38 'node.js':70 'part':26 'proxi':46 'releas':23 'run':64 'script':76 'server':11,36 'slash':49 'ssl/tls':45 'stabl':19 'support':32,47 'termin':68 'test':73 'tool':59 'unlik':54 'version':20 'websocket':8,16,29,58,77,81 'wscat':1,2,60,80","created_at":"2026-06-07T17:03:32.640524+00:00","updated_at":"2026-06-07T17:03:32.640524+00:00","problems":[{"fix":"Run 'npm install -g wscat' to install globally.","cause":"wscat is not installed globally or locally","error":"Error: Cannot find module 'wscat'"},{"fix":"Ensure the server URL is correct and the server is running.","cause":"WebSocket server is not running or unreachable","error":"Error: connect ECONNREFUSED"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/websockets/wscat#readme","github":"https://github.com/websockets/wscat","docs":null,"changelog":null,"pypi":null,"npm":"wscat","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}