Skip to content

Commit 35d5296

Browse files
committed
Firefox quirk
1 parent f6ec2fb commit 35d5296

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/addr.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { algorithm, from_string } from './id.js';
22
import { Conn } from './conn.js';
33
import { query_txt } from './dns.js';
44
import { 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(

0 commit comments

Comments
 (0)