Skip to content

Peer: Exchange Guide

Both clients listen for each other’s Offer and Answer messages at the relay service. Once the Deep Link is received, the Offer client proves its identity using the Liquid Extension then sends an Offer message to the Answer client. The Answer client then sends an Answer message to the Offer client.

Offer ClientLiquid ServiceAnswer ClientOffer ClientLiquid ServiceAnswer ClientPresent QR CodeScan QR CodeReceive Origin and RequestIdAuthenticate/RegisterValidate SignaturesJoin Clients to RoomOk ResponseEmit Offer to OriginEmit Offer to ClientEmit Answer to OriginEmit Answer to Client

ICE Candidates

The clients exchange ICE candidates to establish a connection. The ICE candidates are used to determine the best path for the data to travel between the clients. The clients exchange ICE candidates over the signaling server via WebSockets.

Offer ClientLiquid ServiceAnswer ClientOffer ClientLiquid ServiceAnswer ClientGather ICE CandidatesSend ICE CandidatesSend ICE CandidatesGather ICE CandidatesSend ICE CandidatesSend ICE Candidates

Candidate Discovery

STUN and TURN servers are used as a fallback when a local connection cannot be established on the LAN. The STUN server is used to discover the client’s public IP address, while the TURN server is used to relay data if a direct connection to public IP cannot be established.

The following diagram shows the exchange of STUN/TURN candidates with a client.

TURN ServiceSTUN ServicePeer ATURN ServiceSTUN ServicePeer AGet Local CandidatesGet STUN CandidatesSend STUN CandidatesGet TURN Relay CandidatesSend TURN Relay Candidates