0

When connecting browsers to each others using WebRTC, I have the setting iceTransportPolicy:'all', giving me all types of candidates from the STUN/TURN server.

However, something seems to fail in the state where these candidates are being tested for connection, as the connection forms correctly if both candidates are in same LAN, but I either need to use iceTransportPolicy:'relay'OR NOT SEND candidates of type host/srflx to the other party, to get the TURN connection working. Currently in this case in my code I wait for ice to fail and then for the next connection attempt I first drop typ hostcandidates from being sent to other party and after that I stop sending typ srflx candidates to other party. When I'm sending only the typ relay candidates to the other party the connection succeeds.

I would like the ice to work as it should, being able to form connections (over TURN) even in situations where the host and srflx candidates are useless.

binjamin
  • 123
  • 1
  • 13
Kridls_834
  • 81
  • 8
  • that sounds like something is not right. Have you checked with https://github.com/webrtc/apprtc running on https://appr.tc/ ? If that works as expected (connection establishes) you have a bug somewhere in your code. – Philipp Hancke Nov 04 '19 at 06:05

1 Answers1

0

OP here, I found my mistake, I wanted to sent candidates only when the connection is in a state suitable for new connection, and had forgot to have the state "checking" on that list (new, gathering, checking).

Kridls_834
  • 81
  • 8