Skip to content

Agent protocol ​

This is a summary of the protocol between the nodes and the gateways:

  1. Start: the agent reads https://www.cloud.me/api/agent/bootstrap (or its cached copy) for the gateway list and the fallback entry point.
  2. Pick a gateway: it measures latency and connects to the fastest: wss://<gateway>/v1/ws. If names do not work it connects to the gateways' IP addresses (certificates checked by public-key pin), and only then to the fallback.
  3. Handshake: hello (version, channel, capabilities) → nonce → the agent signs it with its key → welcome and its configuration.
  4. Tasks: the agent checks each task (capabilities, limits, target policy) and answers ack, then result; after the gateway has stored it, it answers result_ack. Until then the agent keeps the result and resends it after reconnecting.
  5. Heartbeat every 25 seconds, with traffic counters.
  6. Upgrades: signed upgrade information; the agent verifies the signature before replacing itself.
  7. Gateway list changes: the configuration carries the list's version; when it changes the agent fetches the bootstrap again and, if needed, moves to a new gateway at a random moment within tens of minutes.

Before any task the agent checks the target: private and reserved addresses and its own local network are refused, and every HTTP request's User-Agent starts with CloudMeTest/.