Skip to content

A CLI tool to start a WebSocket debug server using NodeJS.

License

Notifications You must be signed in to change notification settings

DiscreteTom/ws-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ws-server

npm NPM

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

npm install -g @discretetom/ws-server

Usage

# 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

# show this help
/help
# exit
/exit
# exit
/quit

# send message to all clients
@all <message>
# you can omit @all
<message>

# send message to a specific client
@<id> <message>

# disconnect a client
!<id>

About

A CLI tool to start a WebSocket debug server using NodeJS.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published