ws-testbed-cli provides a command line interface for ws-testbed, running on Node.js.
npm install -g ws-testbed-cli
This will install the CLI globally and provides the script
When installed, run the command
ws-testbed on the console. Without parameters, it will print the usage information and exit:
Usage: ws-testbed connect <url>... [options] ws-testbed serve <port>... [options] ws-testbed load [<cfgfile>] [options] ws-testbed -h | --help ws-testbed --version
Create outgoing connection(s) to the given URL(s).
Create server(s) on the given port(s).
This command optionally loads a previously saved config file. Together with the
--savecfg option this allows a setup to be restored without providing the complete command line again.
This is also the only way to restore a state if a plugin modified control values during runtime.
This will store all control values of all plugins in the given configuration file. This file can then be used later with the "load" command.
PLUGINS is a comma separated list of plugins to load. A plugin is specified with a type, a colon (':') and some parameter for the type. Example:
The connect/serve commands do not provide much functionality without plugins. The power of the testbed comes with plugins, which need to be specified.
Supported Plugin Types
The file type will load the given file (using require()) and expects this file to export a constructor function for an object that implements the PluginExports interface from ws-testbed.
See ws-testbed-chat for a simple plugin.
The project is available under the terms of the New BSD License (see LICENSE file).