wireweave 0.3.13 → 0.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/voice.js +17 -7
package/package.json
CHANGED
package/src/voice.js
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
// ICE servers. STUN handles same-LAN / non-symmetric-NAT cases; TURN is required
|
|
2
|
+
// when both peers sit behind symmetric or restricted-cone NAT (typical home routers,
|
|
3
|
+
// most carrier-grade NAT, corporate networks). The legacy openrelay.metered.ca
|
|
4
|
+
// hostname was retired; the current public-credential endpoint is global.relay.metered.ca.
|
|
5
|
+
// We include UDP, TCP, and TLS variants so at least one path survives strict egress filtering.
|
|
6
|
+
const DEFAULT_ICE_SERVERS = [
|
|
2
7
|
{ urls: 'stun:stun.l.google.com:19302' },
|
|
3
8
|
{ urls: 'stun:stun1.l.google.com:19302' },
|
|
4
9
|
{ urls: 'stun:stun.cloudflare.com:3478' },
|
|
5
|
-
{ urls: 'stun:stun.
|
|
6
|
-
{ urls: 'turn:
|
|
7
|
-
{ urls: 'turn:
|
|
8
|
-
{ urls: 'turn:
|
|
9
|
-
{ urls: 'turns:
|
|
10
|
+
{ urls: 'stun:global.stun.twilio.com:3478' },
|
|
11
|
+
{ urls: 'turn:global.relay.metered.ca:80', username: 'openrelayproject', credential: 'openrelayproject' },
|
|
12
|
+
{ urls: 'turn:global.relay.metered.ca:80?transport=tcp', username: 'openrelayproject', credential: 'openrelayproject' },
|
|
13
|
+
{ urls: 'turn:global.relay.metered.ca:443', username: 'openrelayproject', credential: 'openrelayproject' },
|
|
14
|
+
{ urls: 'turns:global.relay.metered.ca:443?transport=tcp', username: 'openrelayproject', credential: 'openrelayproject' },
|
|
15
|
+
// Legacy hostname kept as a low-priority fallback in case some deployments still resolve it.
|
|
16
|
+
{ urls: 'turn:openrelay.metered.ca:443?transport=tcp', username: 'openrelayproject', credential: 'openrelayproject' }
|
|
10
17
|
];
|
|
18
|
+
let ICE_SERVERS = DEFAULT_ICE_SERVERS;
|
|
19
|
+
export const setIceServers = (list) => { if (Array.isArray(list) && list.length) ICE_SERVERS = list; };
|
|
20
|
+
export const getIceServers = () => ICE_SERVERS.slice();
|
|
11
21
|
|
|
12
22
|
const PRESENCE_EXPIRY = 300000;
|
|
13
23
|
const HEARTBEAT = 30000;
|
|
@@ -421,7 +431,7 @@ export class VoiceSession extends EventTarget {
|
|
|
421
431
|
fsmActor.start();
|
|
422
432
|
const peer = { pc: null, audioEl: null, pendingCandidates: [], bufferedCandidates: [], iceTimer: null, disconnectTimer: null, failCount: 0, state: 'new', fsm: fsmActor, _stallInterval: null, remoteDescSet: false, trackEndedRestart: false };
|
|
423
433
|
this.peers.set(peerPubkey, peer);
|
|
424
|
-
const pc = new RTCPeerConnection({ iceServers: ICE_SERVERS, bundlePolicy: 'max-bundle' });
|
|
434
|
+
const pc = new RTCPeerConnection({ iceServers: ICE_SERVERS, bundlePolicy: 'max-bundle', iceCandidatePoolSize: 4, iceTransportPolicy: 'all' });
|
|
425
435
|
peer.pc = pc;
|
|
426
436
|
const isOfferer = this.auth.pubkey > peerPubkey;
|
|
427
437
|
if (isOfferer) {
|