When the plugin is loaded, the UI takes over. The interface has two widgets: The larger one at the top is the output, showing events and received data. At the bottom is a smaller box with one line for input. Any text entered (and confirmed with ENTER) is sent to all currently connected connections.
ESC switches focus between the two widgets. The output allows scrolling back; The output auto-scrolls only if the last entry is currently selected.
Ctrl+Q terminates the process.
This is a testing plugin that can be used in any ws-testbed based program (running on the console). A typical application is the use with ws-testbed-cli.
Running with ws-testbed-cli
The following example connects to the echo service at http://www.websocket.org/echo.html (ws://echo.websocket.org):
ws-testbed connect ws://echo.websocket.org --plugins=file:src/index.js
(Run from within the root directory of ws-testbed-chat)
blessed library doesn't seem to allow a graceful shutdown, so the interface can not be properly removed by unloading the plugin. In this respect, it is a bad example for proper plugins that should allow being unloaded.
The project is available under the terms of the New BSD License (see LICENSE file).