Skip to content

Commit

Permalink
fix: limit default WebRTC STUN servers to 4x (#2615)
Browse files Browse the repository at this point in the history
Using 5x or more causes the following error to be printed in the
console so only use 4x servers:

```
WebRTC: Using five or more STUN/TURN servers slows down discovery
```
  • Loading branch information
achingbrain committed Jul 10, 2024
1 parent e1f0b30 commit 3319ff4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/transport-webrtc/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
/**
* STUN servers help clients discover their own public IPs
* STUN servers help clients discover their own public IPs.
*
* Using five or more servers causes warnings to be printed so
* ensure we limit it to max x4
*
* @see https://gist.github.com/mondain/b0ec1cf5f60ae726202e
*/
export const DEFAULT_ICE_SERVERS = [
'stun:stun.l.google.com:19302',
'stun:stun1.l.google.com:19302',
'stun:stun2.l.google.com:19302',
'stun:stun3.l.google.com:19302',
'stun:stun4.l.google.com:19302',
'stun:global.stun.twilio.com:3478',
'stun:stun.cloudflare.com:3478',
'stun:stun.services.mozilla.com:3478',
'stun:stun.1und1.de:3478'
'stun:stun.services.mozilla.com:3478'
]

0 comments on commit 3319ff4

Please sign in to comment.