Creating relay ICE candidates

Hi team,

I am having an issue with generating relay candidates. The steps I follow are written below:

  1. Calling createWebRTCTransport from mediasoupclient.
  2. Above api returns DTLS Parameters, ICE Candidates, ICE Parameters.
  3. I append my TURN creds into ICE Servers properties, and call createSendTransport api of mediasoup-client with the details from Step 2.
  4. I have NAT restrictions and my stream requires TURN (relay) ICE candidates.

However, the ICE candidates gathered in step 1 are the only ones available and we provide the TURN servers after the ICE candidates are generated at server side.

Is there a way to generate relay candidates separately?
Am I following the correct steps in transport generation?
If all the steps above are correct, my streams are still blocked. Is there a way to debug where the problem exactly lies?

Sorry, things do not work that way. You must not manually added TURN candidates into the mediasoup-client Transport remote candidates. That’s not how TURN works.

  1. You provide your mediasoup-client Transport with TURN servers.
  2. The peerconnection connects to your TURN server using the TURN protocol by providing the given credentials.
  3. The TURN server provides the peerconnection with relay candidates.
  4. The peerconnection sends its media to that relay candidate and the TURN server relays it to mediasoup.
  5. Period.

Of course, if step 2 does not work (and that’s what you must figure out) nothing will work.