{"id":13514925,"url":"https://github.com/memoryInject/ws-client","last_synced_at":"2025-03-31T04:36:05.593Z","repository":{"id":131262833,"uuid":"472329892","full_name":"memoryInject/ws-client","owner":"memoryInject","description":"WebSocket command line client for testing WebSocket server. | Light weight 🍂 |  Blazing fast ⚡ |  Portable 💼","archived":false,"fork":false,"pushed_at":"2022-03-29T14:43:38.000Z","size":146,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-01T18:38:06.199Z","etag":null,"topics":["bash","blazing-fast","command-line","command-line-tool","console-application","console-tool","cpp","linux-app","multithreading","portable","small-tools","test","testing","testing-tools","websocket","websocket-client","websockets"],"latest_commit_sha":null,"homepage":"https://www.memoryinject.io/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/memoryInject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-03-21T12:36:26.000Z","updated_at":"2024-02-04T07:46:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"fe51ed32-451c-4191-b6b2-0f08ed367819","html_url":"https://github.com/memoryInject/ws-client","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memoryInject%2Fws-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memoryInject%2Fws-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memoryInject%2Fws-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memoryInject%2Fws-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/memoryInject","download_url":"https://codeload.github.com/memoryInject/ws-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246418658,"owners_count":20773934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","blazing-fast","command-line","command-line-tool","console-application","console-tool","cpp","linux-app","multithreading","portable","small-tools","test","testing","testing-tools","websocket","websocket-client","websockets"],"created_at":"2024-08-01T05:01:03.962Z","updated_at":"2025-03-31T04:36:04.696Z","avatar_url":"https://github.com/memoryInject.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"\n# WS Client\n\nWebSocket command line client for testing WebSocket server.  \nThis command line tools based on https://github.com/dhbaird/easywsclient,   \nJSON Parsing using https://github.com/nlohmann/json,   \nConsole color and formatting using https://github.com/memoryInject/color-console.  \n\n#### **This application still in an early development phase, only tested with Linux. (It might works on macOS)\n## Screenshots\n\n![App Screenshot](https://res.cloudinary.com/memoryinject/image/upload/h_458,c_scale/v1648024478/ws-client-01_lldds8.png)\n\n![App Screenshot](https://res.cloudinary.com/memoryinject/image/upload/h_458,c_scale/v1648024485/ws-client-02_sl3b32.png)\n\n\n\n## Features\n- Light weight 🍂\n- Blazing fast ⚡\n- Portable 💼\n- JSON formatted output to console.\n- JSON support for sending message.\n- Auto reconnect, wait for 5 seconds.\n- Keywords for manual reconnect (`r`, `reset`, `reconnect`, `restart`).\n- Keywords for exit/closing connection (`q`, `quit`, `exit`).\n- Keywords for send message to server (`res`, `send`, `response`).\n- Keywords for help (`h`, `help`).\n\n\n## Build\n\nTo build the executable download this repo first, then use `make` to create the executable.\n\n```bash\ngit clone https://github.com/memoryInject/ws-client\ncd ws-client\nmake\n```\n\nAfter running the code above it will create executable at `bin/ws`\n\n#### Optional:\nIf you want to move the `ws` executable to `~/bin`, run `make move` after running `make`, \nthis will make `ws` added to `path`. \n## Usage/Examples\nMake sure you build the `ws` executable and added to system `path`.   \nTo connect to a WebSocket server pass the WebSocket address as first argument.\n\n```bash\n❯ ws 'ws://localhost:8000/ws'\nConnected: ws://localhost:8000/ws\n\n\u003e\u003e\u003e JSON Data:\n{\n    \"message\": \"connected\"\n}\n\n\u003e\u003e\u003e JSON Data:\n{\n    \"message\": \"Hello World!\",\n    \"type\": \"notification\"\n}\n```\n\nTo exit the program type `q` and `enter`\n```bash\n~\n❯ ws 'ws://localhost:8000/ws'\nConnected: ws://localhost:8000/ws\n\n\u003e\u003e\u003e JSON Data:\n{\n    \"message\": \"connected\"\n}\n\n\u003e\u003e\u003e JSON Data:\n{\n    \"message\": \"Hello World!\",\n    \"type\": \"notification\"\n}\nq\nExit\nConnection closed: ws://localhost:8126/ws\n~\n❯ \n```\n   \nTo restart the program type `r` and `enter`\n```bash\n~                                                                                  \n❯ ws 'ws://localhost:8126/ws'\nConnected: ws://localhost:8126/ws\n\n\u003e\u003e\u003e JSON Data:\n{\n    \"message\": \"connected\"\n}\n\nr\nReset connection\nConnection closed: ws://localhost:8126/ws\nConnected: ws://localhost:8126/ws\n\n\u003e\u003e\u003e JSON Data:\n{\n    \"message\": \"connected\"\n}\n```\n\nTo send message to server type `res` and `enter` then type message as `string` or `json` then `enter` to send.\n```bash\n~                                                                                     \n❯ ws 'ws://localhost:8126/ws'\nConnected: ws://localhost:8126/ws\n\n\u003e\u003e\u003e JSON Data:\n{\n    \"message\": \"connected\"\n}\n\n\u003e\u003e\u003e JSON Data:\n{\n    \"message\": \"hello from server\",\n    \"type\": \"notification\"\n}\nres\nMessage: hello\n\n\u003c\u003c\u003c hello\n\n\u003e\u003e\u003e world\nres\nMessage: { \"msg\": \"world\", \"type\": \"info\" }\n\n\u003c\u003c\u003c JSON Data:\n{\n    \"msg\": \"world\",\n    \"type\": \"info\"\n}\n\n```\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FmemoryInject%2Fws-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FmemoryInject%2Fws-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FmemoryInject%2Fws-client/lists"}