Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/discretetom/ws-server
A CLI tool to start a WebSocket debug server using NodeJS.
https://github.com/discretetom/ws-server
cli nodejs websocket ws wscat
Last synced: 12 days ago
JSON representation
A CLI tool to start a WebSocket debug server using NodeJS.
- Host: GitHub
- URL: https://github.com/discretetom/ws-server
- Owner: DiscreteTom
- License: mit
- Created: 2023-03-17T02:21:47.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-18T08:14:15.000Z (over 1 year ago)
- Last Synced: 2025-01-17T06:28:53.502Z (about 1 month ago)
- Topics: cli, nodejs, websocket, ws, wscat
- Language: JavaScript
- Homepage:
- Size: 157 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ws-server
[](https://www.npmjs.com/package/@discretetom/ws-server)
A CLI tool to start a WebSocket debug server using NodeJS.
This is useful when you want to mock a WebSocket server to test your WebSocket client.
## Installation
```bash
npm install -g @discretetom/ws-server
```## Usage
```bash
# ws-server --help
Options:
--help Show help [boolean]
--version Show version number [boolean]
-p, --port [number] [default: 8080]
-h, --header Show header [boolean] [default: false]
-T, --no-trim Don't trim message [boolean] [default: false]
-e, --allow-empty Allow empty message [boolean] [default: false]
-E, --echo Print message from the server [boolean] [default: false]
```## Commands
```bash
# show this help
/help
# exit
/exit
# exit
/quit# send message to all clients
@all
# you can omit @all# send message to a specific client
@# disconnect a client
!
```## [CHANGELOG](https://github.com/DiscreteTom/ws-server/blob/main/CHANGELOG.md)