Expand description
There are 2 state machines in this module:
discovery
- used for discovering a new target peer and initiating signaling process.exchange
- used by intermediary peer to relay an offer to the target peer and receive an answer from it.
These are the overall steps that happens in these state machines in order to connect two (dialer and listener) peers to each other using intermediary peer (relayer):
- discovery Dialer asks relayer to discover an available peer.
- discovery Relayer responds with available peer’s (listener’s) public key.
- discovery Dialer accepts/rejects the target peer (listener).
- discovery If dialer accepts the peer, it sends webrtc offer to relayer.
- exchange Relayer relays received webrtc offer to the listener peer.
- exchange Relayer receives webrtc answer from the listener peer.
- discovery Relayer relays the answer to the dialer.