Both Docker and docker-compose should be installed.
git clone https://github.com/Telichkin/simple_chat.git
cd simple_chat
docker-compose build
docker-compose up
Application will run on http://localhost:8000
POST /users/
Content-Type: application/json
{"username": "newUser", "password": "Weak!"}
POST /auth/
Content-Type: application/json
{"username": "matureUser", "password": "Strong?"}
Both creation and authentication methods return token in response body.
event | required payload fields |
---|---|
"auth" | "token" |
"send private message" | "message", "to" |
"broadcast" | "message" |
"connect" | None |
"disconnect" | None |
Before start to use other events you need to authenticate through "auth" event with token.
event | required payload fields |
---|---|
"connect" | None |
"disconnect" | None |
event | data |
---|---|
"send private message" | {"message": .., "author": .., "to": ..} |
"broadcast" | {"message": .., "author": .., "to": None} |
"private history" | list with messages from "send private message" |
"broadcast history" | list with messages from "broadcast" |
"error" | error message |
event | data |
---|---|
"update" | list with user names of active users |