Fix WebRTCProvider inizialization (#328)

pull/325/head
Anastasiia Kim 3 days ago committed by GitHub
parent b49c91373b
commit 8801c044a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -10,7 +10,7 @@ const peerjsPath = process.env.PEERJS_PATH || '/'
export async function POST(): Promise<NextResponse> { export async function POST(): Promise<NextResponse> {
if (!process.env.COTURN_ENABLED) { if (!process.env.COTURN_ENABLED) {
return NextResponse.json({ return NextResponse.json({
host: peerjsHost, host: peerjsHost,
path: peerjsPath, path: peerjsPath,
iceServers: [{ urls: stunServer }], iceServers: [{ urls: stunServer }],
}) })
@ -25,7 +25,7 @@ export async function POST(): Promise<NextResponse> {
await setTurnCredentials(username, password, ttl) await setTurnCredentials(username, password, ttl)
return NextResponse.json({ return NextResponse.json({
host: peerjsHost, host: peerjsHost,
path: peerjsPath, path: peerjsPath,
iceServers: [ iceServers: [
{ urls: stunServer }, { urls: stunServer },

@ -41,10 +41,10 @@ async function getOrCreateGlobalPeer(): Promise<Peer> {
globalPeer = new Peer({ globalPeer = new Peer({
debug: 3, debug: 3,
host,
path,
config: { config: {
iceServers, iceServers,
host,
path,
}, },
}) })
} }

Loading…
Cancel
Save