Protocol and connection modes

Reemo establishes a real-time session between a client (web client or Reemo Thin Client) and a target resource (Reemo Desktop agent, container, or virtual machine). This session carries the remote display, audio, and control events (keyboard, mouse, peripherals) in both directions.

To route this stream, Reemo relies on two transport families: WebRTC, over a direct or relayed link, and WebSocket. The mode used depends on the network topology and the infrastructure choice.

The three connection modes

A client and the Reemo Agent connect through three modes: direct WebRTC over UDP peer to peer, relayed WebRTC where both the client and the agent reach a TURN server, and WebSocket where both reach a RELAYWS relay.

The three connection modes between the client and the Reemo Agent.

Direct WebRTC

The client and the resource communicate peer to peer, with no intermediary on the media path. WebRTC uses the ICE protocol to discover the most direct path, helped by STUN to traverse a simple NAT.

This is the most efficient mode: minimal latency and no bandwidth consumed on a relay. It assumes a direct path can be established between the two peers.

Relayed WebRTC (TURN)

When no direct link is possible — symmetric NAT, corporate firewall, network that only allows outbound traffic to port 443 — WebRTC falls back to a TURN server, which relays the entire stream.

This fallback is negotiated by ICE within the same WebRTC connection: the client has nothing to configure. The session is guaranteed at the cost of bandwidth usage on the relay.

WebSocket (RELAYWS)

The WebSocket mode is an alternative to WebRTC, chosen at the infrastructure level through the RELAYWS environment. For each connection, a dedicated relay container is deployed on the fly: the client and the resource connect to it, and the container forwards packets in both directions.

This mode isolates each connection in its own container and requires only WebSocket streams over HTTPS, which suits highly constrained networks where WebRTC cannot be used.

How Reemo selects the mode

  • The WebRTC or WebSocket choice is made at the infrastructure level: an instance that deploys RELAYWS routes sessions over WebSocket, otherwise they go through WebRTC.

  • Within WebRTC, the direct or relayed choice is automatic and negotiated connection by connection by ICE: the direct path is tried first, and the TURN relay serves as a fallback.

The result is transparent to the user: the session is established with the best transport available for the network and the instance configuration. See Network flows and ports for the ports and flows involved.