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.
npm install -g @discretetom/ws-server
# 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]
# 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>