Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
memoryInject authored Mar 23, 2022
1 parent 37bc583 commit bbdaa09
Showing 1 changed file with 89 additions and 2 deletions.
91 changes: 89 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,89 @@
# ws-client
WebSocket client for command line testing WebSocket server

# WS Client

WebSocket command line client for testing WebSocket server.
This command line tools based on https://github.com/dhbaird/easywsclient,
JSON Parsing using https://github.com/nlohmann/json,
Console color and formatting using https://github.com/memoryInject/color-console.

#### **This application still in an early development phase, only tested with Linux. (It might works on macOS)
## Screenshots

![App Screenshot](https://res.cloudinary.com/memoryinject/image/upload/h_458,c_scale/v1648024478/ws-client-01_lldds8.png)

![App Screenshot](https://res.cloudinary.com/memoryinject/image/upload/h_258,c_scale/v1648024485/ws-client-02_sl3b32.png)



## Features

- JSON formatted output to console.
- Auto reconnect, wait for 5 seconds.
- Keywords for manual reconnect (`r`, `reset`, `reconnect`, `restart`).
- Keywords for exit/closing connection (`q`, `quit`, `exit`).
- Keywords for help (`h`, `help`).
- Light weight 🍂
- Blazing fast ⚡
- Portable 💼

## Build

To build the executable download this repo first, then use `make` to create the executable.

```bash
git clone https://github.com/memoryInject/ws-client
cd ws-client
make
```

After running the code above it will create executable at `bin/ws`

#### Optional:
If you want to move the `ws` executable to `~/bin`, run `make move` after running `make`,
this will make `ws` added to `path`.
## Usage/Examples
Make sure you build the `ws` executable and added to system `path`.
To connect to a WebSocket server pass the WebSocket address as first argument.

```bash
❯ ws 'ws://localhost:8000/ws'
Connected: ws://localhost:8000/ws

>>> JSON Data:
{
"message": "connected"
}

>>> JSON Data:
{
"message": "Hello World!",
"type": "notification"
}
```

To exit the program type `q` and `enter`
```bash
~
❯ ws 'ws://localhost:8000/ws'
Connected: ws://localhost:8000/ws

>>> JSON Data:
{
"message": "connected"
}

>>> JSON Data:
{
"message": "Hello World!",
"type": "notification"
}
q
Exit
~
```

## License

[MIT](https://choosealicense.com/licenses/mit/)

0 comments on commit bbdaa09

Please sign in to comment.