forked from Shiloh/remnantchat
refactor: move rtcConfig to its own file
This commit is contained in:
parent
50d622d9f9
commit
d277820961
@ -3,6 +3,7 @@ import { v4 as uuid } from 'uuid'
|
|||||||
import Box from '@mui/material/Box'
|
import Box from '@mui/material/Box'
|
||||||
import Divider from '@mui/material/Divider'
|
import Divider from '@mui/material/Divider'
|
||||||
|
|
||||||
|
import { rtcConfig } from 'config/rtcConfig'
|
||||||
import { ShellContext } from 'contexts/ShellContext'
|
import { ShellContext } from 'contexts/ShellContext'
|
||||||
import { usePeerRoom, usePeerRoomAction } from 'hooks/usePeerRoom'
|
import { usePeerRoom, usePeerRoomAction } from 'hooks/usePeerRoom'
|
||||||
import { PeerActions } from 'models/network'
|
import { PeerActions } from 'models/network'
|
||||||
@ -36,28 +37,7 @@ export function Room({
|
|||||||
trackerUrls: process.env.REACT_APP_TRACKER_URL
|
trackerUrls: process.env.REACT_APP_TRACKER_URL
|
||||||
? [process.env.REACT_APP_TRACKER_URL]
|
? [process.env.REACT_APP_TRACKER_URL]
|
||||||
: undefined,
|
: undefined,
|
||||||
rtcConfig: {
|
rtcConfig,
|
||||||
iceServers: [
|
|
||||||
{
|
|
||||||
urls: 'stun:openrelay.metered.ca:80',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
urls: 'turn:openrelay.metered.ca:80',
|
|
||||||
username: 'openrelayproject',
|
|
||||||
credential: 'openrelayproject',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
urls: 'turn:openrelay.metered.ca:443',
|
|
||||||
username: 'openrelayproject',
|
|
||||||
credential: 'openrelayproject',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
urls: 'turn:openrelay.metered.ca:443?transport=tcp',
|
|
||||||
username: 'openrelayproject',
|
|
||||||
credential: 'openrelayproject',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
roomId
|
roomId
|
||||||
)
|
)
|
||||||
|
22
src/config/rtcConfig.ts
Normal file
22
src/config/rtcConfig.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
export const rtcConfig: RTCConfiguration = {
|
||||||
|
iceServers: [
|
||||||
|
{
|
||||||
|
urls: 'stun:openrelay.metered.ca:80',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
urls: 'turn:openrelay.metered.ca:80',
|
||||||
|
username: 'openrelayproject',
|
||||||
|
credential: 'openrelayproject',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
urls: 'turn:openrelay.metered.ca:443',
|
||||||
|
username: 'openrelayproject',
|
||||||
|
credential: 'openrelayproject',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
urls: 'turn:openrelay.metered.ca:443?transport=tcp',
|
||||||
|
username: 'openrelayproject',
|
||||||
|
credential: 'openrelayproject',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user