code: function iceCandidateFilter( iceCandidate, fromPeer) {
     var sdp = iceCandidate.candidate;
     if( sdp.indexOf("typ relay") > 0) { // is turn candidate
         if( document.getElementById("allowTurn").checked ) {
             return iceCandidate;
         }
         else {
             return null;
         }
     }
     else if( sdp.indexOf("typ srflx") > 0) { // is turn candidate
         if( document.getElementById("allowStun").checked ) {
             return iceCandidate;
         }
         else {
             return null;
         }
     }
     else if( sdp.indexOf("typ host") > 0) { // is turn candidate
         if( document.getElementById("allowLocal").checked ) {
             return iceCandidate;
         }
         else {
             return null;
         }
     }
     else {
        console.log("Unrecognized type of ice candidate, passing through: " + sdp);
     }
  }
docs: filter ice candidates according to the ice candidates checkbox.