|
1 |
| -const get = require('simple-get') |
2 |
| -const thunky = require('thunky') |
3 | 1 | const bowser = require('bowser')
|
4 | 2 |
|
5 |
| -exports.getConfig = thunky(function (cb) { |
6 |
| - // Includes TURN -- needed for tests to pass on Sauce Labs |
7 |
| - // https://github.com/feross/simple-peer/issues/41 |
8 |
| - // WARNING: This is *NOT* a public endpoint. Do not depend on it in your app. |
9 |
| - get.concat('https://instant.io/__rtcConfig__', function (err, res, data) { |
10 |
| - if (err) return cb(err) |
11 |
| - data = data.toString() |
12 |
| - try { |
13 |
| - data = JSON.parse(data) |
14 |
| - } catch (err) { |
15 |
| - cb(err) |
16 |
| - return |
| 3 | +exports.getConfig = cb => { |
| 4 | + const data = { |
| 5 | + rtcConfig: { |
| 6 | + iceServers: [ |
| 7 | + { |
| 8 | + urls: [ |
| 9 | + 'stun:stun.l.google.com:19302', |
| 10 | + 'stun:global.stun.twilio.com:3478' |
| 11 | + ] |
| 12 | + }, |
| 13 | + { |
| 14 | + urls: [ |
| 15 | + 'turn:relay.socket.dev:443?transport=udp', |
| 16 | + 'turn:relay.socket.dev:443?transport=tcp', |
| 17 | + 'turns:relay.socket.dev:443?transport=tcp' |
| 18 | + ], |
| 19 | + username: 'relay.socket.dev', |
| 20 | + credential: 'tears-whiplash-overall-diction' |
| 21 | + } |
| 22 | + ], |
| 23 | + sdpSemantics: 'unified-plan', |
| 24 | + bundlePolicy: 'max-bundle', |
| 25 | + iceCandidatePoolsize: 1 |
17 | 26 | }
|
18 |
| - cb(null, data) |
19 |
| - }) |
20 |
| -}) |
| 27 | + } |
| 28 | + cb(null, data) |
| 29 | +} |
21 | 30 |
|
22 | 31 | // For testing on node, we must provide a WebRTC implementation
|
23 | 32 | if (process.env.WRTC?.startsWith('wrtc')) {
|
|
0 commit comments