I'm creating a WebRTC connection between two laptops on the same network. I would expect the TURN server to NOT be chosen as the connection, but it currently is. I've taken a look at the ICE candidates and they seem to have my turn server as the bottom in terms of priority. Here's a JSON representation of my state:
"connection": {
"version": 4,
"ip": "64.227.54.86\\r\\n"
},
"candidates": [
{
"foundation": 175723363,
"component": 1,
"transport": "udp",
"priority": 2122260223,
"ip": "192.168.86.64",
"port": 64242,
"type": "host",
"generation": 0,
"network-id": 1,
"network-cost": 50,
"_priority": "126 | 32542 | 255"
},
{
"foundation": 2335266263,
"component": 1,
"transport": "udp",
"priority": 1686052607,
"ip": "24.6.16.241",
"port": 64242,
"type": "srflx",
"raddr": "192.168.86.64",
"rport": 64242,
"generation": 0,
"network-id": 1,
"network-cost": 50,
"_priority": "100 | 32542 | 255"
},
{
"foundation": 1157279635,
"component": 1,
"transport": "tcp",
"priority": 1518280447,
"ip": "192.168.86.64",
"port": 64852,
"type": "host",
"tcptype": "passive",
"generation": 0,
"network-id": 1,
"network-cost": 50,
"_priority": "90 | 32542 | 255"
},
{
"foundation": 1039353576,
"component": 1,
"transport": "udp",
"priority": 41885695,
"ip": "64.227.54.86",
"port": 38537,
"type": "relay",
"raddr": "24.6.16.241",
"rport": 64242,
"generation": 0,
"network-id": 1,
"network-cost": 50,
"_priority": "2 | 32543 | 255"
},
{
"foundation": 1936767512,
"component": 1,
"transport": "udp",
"priority": 25108223,
"ip": "64.227.54.86",
"port": 57994,
"type": "relay",
"raddr": "24.6.16.241",
"rport": 64851,
"generation": 0,
"network-id": 1,
"network-cost": 50,
"_priority": "1 | 32542 | 255"
}
],
My question is, is there a way to debug why exactly a particular ICE candidate is chosen over others? I would love to understand why a particular one is chosen.
To provide a bit more context, ICE is selecting a TURN server as the connection when there is a perfectly valid non-TURN connectivity pathway that is possible. This is confirmed by taking off the TURN server from the ICE server list and having everything work.