2
votes

I want to create something similar like chat roulette: There are two peers. Both peers send an SDP offer to the signaling server asking it to get connected with someone. The signaling server uses the offer of peer A to send it as an answer to peer B and vice versa.

Both peers could setLocalDescription() and setRemoteDescription() without using createAnswer().

Could they now go to the next step and exchange candidates? Or is it necessary that at least one is sending a real answer created with createAnswer()?

1

1 Answers

2
votes

No. An offer is not an answer. An answer builds on an offer, it's a refinement, an iteration on it, a negotiation.

The offer-answer exchange is inherently asymmetric, so your peers will be in incompatible states if they've both sent out offers.

Instead, solve discovery (pairing) of A and B first, then do WebRTC from A to B.