diff --git a/client/app/composables/use-mediasoup.ts b/client/app/composables/use-mediasoup.ts index 8ad0e1e..d478e23 100644 --- a/client/app/composables/use-mediasoup.ts +++ b/client/app/composables/use-mediasoup.ts @@ -3,6 +3,19 @@ import { createGlobalState } from '@vueuse/core' import * as mediasoupClient from 'mediasoup-client' import { io } from 'socket.io-client' +const ICE_SERVERS: RTCIceServer[] = [ + { urls: 'stun:stun.l.google.com:19302' }, + { urls: 'stun:stun.l.google.com:5349' }, + { urls: 'stun:stun1.l.google.com:3478' }, + { urls: 'stun:stun1.l.google.com:5349' }, + { urls: 'stun:stun2.l.google.com:19302' }, + { urls: 'stun:stun2.l.google.com:5349' }, + { urls: 'stun:stun3.l.google.com:3478' }, + { urls: 'stun:stun3.l.google.com:5349' }, + { urls: 'stun:stun4.l.google.com:19302' }, + { urls: 'stun:stun4.l.google.com:5349' }, +] + export const useMediasoup = createGlobalState(() => { const socket: Socket = io('https://api.koptilnya.xyz', { path: '/chad/ws/', @@ -46,7 +59,7 @@ export const useMediasoup = createGlobalState(() => { sendTransport = device.createSendTransport({ ...params, iceServers: [ - { urls: 'stun:stun.sipnet.ru:3478' }, + ...ICE_SERVERS, ...(params.iceServers ?? []), ], }) @@ -92,7 +105,7 @@ export const useMediasoup = createGlobalState(() => { recvTransport = device.createRecvTransport({ ...params, iceServers: [ - { urls: 'stun:stun.sipnet.ru:3478' }, + ...ICE_SERVERS, ...(params.iceServers ?? []), ], })