diff --git a/documentation/source/rdfm_mgmt_server.md b/documentation/source/rdfm_mgmt_server.md index 86a67a10..84062661 100644 --- a/documentation/source/rdfm_mgmt_server.md +++ b/documentation/source/rdfm_mgmt_server.md @@ -47,7 +47,8 @@ export JWT_SECRET="THISISATESTDEVELOPMENTSECRET123" poetry build && poetry install && poetry run python -m rdfm_mgmt_server --no-ssl --no-api-auth --local-package-dir ./packages/ ``` -This launches the RDFM Management Server with no encryption, listening on `localhost`/`127.0.0.1`. By default, the device communication socket is listening on port `1234`, while the HTTP API is exposed on port `5000`. +This launches the RDFM Management Server with no encryption, listening on `localhost`/`127.0.0.1`. +By default, the HTTP API is exposed on port `5000`. When server is in debug mode (`app.run(debug=True, ...)` is set) every HTTP request received and response to it are printed to STDOUT. diff --git a/documentation/source/system_overview.md b/documentation/source/system_overview.md index 1b176151..13bd7f34 100644 --- a/documentation/source/system_overview.md +++ b/documentation/source/system_overview.md @@ -21,25 +21,23 @@ in the [RDFM Server API Reference](api.rst) chapter. The clients use this API to ## Device-server RDFM Protocol -The devices also maintain a persistent connection to the RDFM Management Server by utilizing a custom JSON-based message protocol. +The devices also maintain a persistent connection to the RDFM Management Server by utilizing JSON-based messages sent over a WebSocket route. This is used to securely expose additional management functionality without directly exposing device ports to the Internet. Each message sent using the RDFM protocol is structured as follows: ```text -0 10 10+h -+---------+----------------------------+ -| HEADER | utf-8 encoded JSON message | -+---------+----------------------------+ +0 h ++----------------------------+ +| utf-8 encoded JSON message | ++----------------------------+ ``` -The header is a 10-bytes UTF-8 encoded number representing the total length in bytes of the following message being sent. - -The message is a UTF-8 encoded JSON object. Request and response messages are distinguished by the mandatory ``'method'`` field. +The message is a UTF-8 encoded JSON object, where each message is distinguished by the mandatory ``'method'`` field. An example request sent to the server may look like: -``{'method': 'register', 'client': {'group': 'USER', 'name': 'testuser'}}`` +``{'method': 'capability_report', 'capabilities': {'shell': True}}`` A response from the server may look like: