You can force to use TURN server by dropping all other ICE candidates except relay candidate allocated by TURN server before sending out to other peer.
For example,
function onIceCandidate(event) {
if (event.candidate) {
console.log(\"onIceCandidate, \" + event.candidate.candidate);
var components = event.candidate.candidate.split(\" \");
if (components[7] == \"relay\") {
var candidateMsg = {type: 'candidate',
label: event.candidate.sdpMLineIndex,
id: event.candidate.sdpMid,
candidate: event.candidate.candidate};
send(candidateMsg);
} else {
console.log(\"Ignore local host.\");
}
} else {
console.log(\"End of candidates.\");
}
}
/Kaiduan