File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { algorithm, from_string } from './id.js';
22import { Conn } from './conn.js' ;
33import { query_txt } from './dns.js' ;
44import { default_turn_credential , default_turn_username } from './const.js' ;
5- import { state } from './util.js' ;
5+ import { is_firefox , state } from './util.js' ;
66/**
77 * Example Addr-esses:
88 * const a = new Addr('udp:seed.evan-brass.net'); await a.resolve_id(); const conn = a.connect();
@@ -58,7 +58,15 @@ export class Addr extends URL {
5858 const { 1 : proto , 2 : transport } = turn_res ;
5959 const { host } = this . authority ;
6060 return {
61- iceTransportPolicy : 'relay' ,
61+ /**
62+ * HACK: If iceTransportPolicy=='relay' then Firefox will kill local relay candidates if they become prflx candidates.
63+ * Chrome doesn't do this.
64+ * - https://www.rfc-editor.org/rfc/rfc9429#section-4.1.1
65+ * - https://www.rfc-editor.org/rfc/rfc9429#sec.ice-candidate-policy
66+ *
67+ * ISSUE: If I knew what the right thing to do was...
68+ */
69+ iceTransportPolicy : is_firefox ? 'all' : 'relay' ,
6270 iceServers : [ {
6371 urls : `${ proto } :${ host } ${ transport ? '?transport=' + transport : '' } ` ,
6472 username : decodeURIComponent (
You can’t perform that action at this time.
0 commit comments