- a client should include a valid JWT token in HTTP upgrade request cookie. the cookie should have a name/value like this:
token=valid-jwt-token The server reply a 400 bad request HTTP response if no cookie presented in the request. The server reply a 400 bad request HTTP response also in case of an empty value or the token key absence. a 401 HTTP response code indicates the token value is not valid. - After a successful connection a client may subscribe on a topic in order to receive messages.
The subscription request should have a valid json body in the following format:
Any subscription request should include a valid JWT token, if the client does not have the permission to subscribe
{"token": "some-valid-token", "topic": "topic-name"}
the server would send a False state result with 'token access denied' detail.
A server response to the subscription request is a json in the following format:{"result": true, "detail": "optional"} // successful subscription {"result": false, "detail": "the reason"} // unsuccessful subscription
- after a successful subscription the server may send messages to subscribed clients.
the subscribed messages are in the following format:
{"topic": "topic-name", "payload": {}}
Examples of using WebSocket: click
- alerts:
Alerts from the core system.
{"ticket_id": "'|' splitted string", "msg": "blah blah blah", "history_id": 54}
- activities:
Activities reports from the core system.
{"ticket_id": "'|' splitted string", "msg": "blah blah blah", "history_id": 54}
- RABBITMQ_HOST
- RABBITMQ_PORT
- RABBITMQ_USER
- RABBITMQ_PASSWORD
- AUTHORIZATION_URL
- LOG_LEVEL
- LOG_PREFIX
sudo docker run -p9000:9000 -e RABBITMQ_HOST=192.168.101.101\
-e AUTHORIZATION_URL='http://192.168.101.101:5000/user_info' docker-image-name