This programs send a random phrase to a web chat program. It was created for testing purposes, to generate useful traffic. The phrase is converted into a JSON structure and then sent via HTTP POST. The program waits a few (random) seconds and then loops forever, until the user stops the program with SIGINT or SIGTERM.
The chat program source code is on GitHub here: https://github.com/nbrandaleone-gcp/kemal-redis-chat
Follow Crystal installation instuctions.
crystal run src/send-chat.cr -- -u http://localhost:3000/msg
send-chat -u http://localhost:3000/msg
Or, if you prefer a pre-built docker container:
docker run --rm nbrand/send-chat:0.1 -u <URL>/msg
Important
You MUST add /msg
to the end of URL, in order for the chat
server to process the incoming messages. Otherwise, the data
hits the main web page of the chat server, and is ignored.
'msg' is a dedicated API endpoint that handles JSON input.
TODO: Write development instructions here
- Fork it (https://github.com/your-github-user/send-msg/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- Nick Brandaleone - creator and maintainer