A Go command-line tool for interacting with WebSocket servers. It's designed for testing and scripting, offering similar functionality to wscat with some enhancements. This tool is currently under active development.
Features
Native Binaries: Distributable and easy to install.
Piped Input: Use the --stdin flag to pipe input to the WebSocket server. Note: Interactive terminal features are not available when using piped input.
Multiple Messages on Connect: Send a series of messages immediately upon establishing the connection.
Background Execution:
Run in the background using nohup (redirect output to nohup.out and use -w to wait for messages). Example: nohup wscli -c ws://localhost/ws -w 1s > nohup.out 2>&1 &
Redirect output and run in the background. Example: wscli -c ws://localhost/ws >> output.txt & 2>&1
History Persistence: Maintain a history of commands for easy reuse.
Command Execution on Connect: Use the -x flag (multiple times for multiple commands) to execute commands immediately after connection. An interactive terminal will open after the commands are executed.
JSON Pretty Printing: Format server responses as nicely formatted JSON using the --jspp flag.
Terminal Shortcuts: Utilize standard terminal shortcuts like Ctrl+W (delete word) and Ctrl+R (reverse search). A full list of available readline shortcuts can be found here.