@danhab99/ws-cli

A websocket client for cli

Decided to rename the package to something unique. Please download this instead: https://www.npmjs.com/package/interactive-websocket-cli
Last updated 8 months ago by danhab99 .
GPL-3.0-or-later · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @danhab99/ws-cli 
SYNC missed versions from official npm registry.

ws-cli

npm GitHub forks GitHub Release Date github npm stars

An interactive websocket utility suite

Installation

npm i -g @danhab99/ws-cli

Usage

wscli

wscli provides an interactive websocket client/server

Usage: wscli [options] [command]

Options:
  -V, --version                          output the version number
  -p, --pipe                             Pipe stdin to server and server to stdout
  -t, --tab-size <t>                     Set the tab size (default: 2)
  -i, --in <files>                       Use files as input (default: [])
  -o, --out <file>                       Output to file
  -u, --ugly                             No pretty print
  -d, --time-format <format>             Set the timestamp format (default: "YYYY/MM/DD HH:mm:ss(SSS[ms])")
  --server-config <file or JSON string>  Use a JSON object for any websocket server options
  --client-config <file or JSON string>  Use a JSON object for any websocket client options
  -h, --help                             output usage information

Commands:
  listen <port>                          Listen for websocket connections on a port
  connect <address>                      Connect to a websocket at an address

Notes: 
  * Pipe (-p) must be enabled when using file inputs (--in)
  * Specifying multiple --in(s) will chain together each the files and feed them through one at a time
  * Enabling ugly print (--ugly) will ignore --tab-size
  * Adress will be completed (ex. echo.websocket.org => ws://echo.websocket.org, 9000 => ws://localhost:9000)
  * --server-config and --client-config expect a JSON string conforming to https://github.com/websockets/ws/blob/HEAD/doc/ws.md#new-websocketaddress-protocols-options
  * --time-format strings are based off of https://momentjs.com/

As a client

Run ws-cli connect [host]. Once you see the !!! Connected message, press h for help, all further commands are triggered by the correct keypress.


      [s] send a message to server

As a server

Run ws-cli listen [port], press h for help


      [s] open select prompt, used to select which connections are being displayed and will receive transmit messages. comma seperated numbers
      [S] print selected clients
      [t] transmits message to selected clients
      [b] broadcasts message to all clients
      [k] close selected clients
   

wstee

wstee provides a proxy websocket for monitoring websocket connections. By default it will pipe stdio to the websocket although files can be provided as in/output

Usage: wstee [options]

Options:
  -V, --version                          output the version number
  -p, --pipe                             Pipe stdin to server and server to stdout
  -t, --tab-size <t>                     Set the tab size (default: 2)
  -i, --in <files>                       Use files as input (default: [])
  -o, --out <file>                       Output to file
  -u, --ugly                             No pretty print
  -d, --time-format <format>             Set the timestamp format (default: "YYYY/MM/DD HH:mm:ss(SSS[ms])")
  --server-config <file or JSON string>  Use a JSON object for any websocket server options
  --client-config <file or JSON string>  Use a JSON object for any websocket client options
  --connect-incoming <port or address>   Open a port to allow one client to connect (default: [])
  --connect-outgoing <port or address>   Connect to server  (default: [])
  -h, --help                             output usage information

Notes: 
  * Pipe (-p) must be enabled when using file inputs (--in)
  * Specifying multiple --in(s) will chain together each the files and feed them through one at a time
  * Enabling ugly print (--ugly) will ignore --tab-size
  * Adress will be completed (ex. echo.websocket.org => ws://echo.websocket.org, 9000 => ws://localhost:9000)
  * --server-config and --client-config expect a JSON string conforming to https://github.com/websockets/ws/blob/HEAD/doc/ws.md#new-websocketaddress-protocols-options
  * --time-format strings are based off of https://momentjs.com/

Note

When using -p, wstee will instead display the bitrate of data being transfered

Current Tags

  • 1.4.2                                ...           latest (8 months ago)

10 Versions

  • 1.4.2 [deprecated]           ...           8 months ago
  • 1.4.1 [deprecated]           ...           8 months ago
  • 1.4.0 [deprecated]           ...           8 months ago
  • 1.3.1 [deprecated]           ...           8 months ago
  • 1.3.0 [deprecated]           ...           8 months ago
  • 1.2.1 [deprecated]           ...           8 months ago
  • 1.2.0 [deprecated]           ...           8 months ago
  • 1.0.0 [deprecated]           ...           8 months ago
  • 0.0.2 [deprecated]           ...           8 months ago
  • 0.0.1 [deprecated]           ...           9 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |