From 317708ddd56df824fe685e7b62bdd26baaab9479 Mon Sep 17 00:00:00 2001 From: Alex Kern Date: Wed, 16 Jul 2025 20:31:44 -0700 Subject: [PATCH] feat: allow custom STUN server --- src/app/api/ice/route.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/api/ice/route.ts b/src/app/api/ice/route.ts index 8dedc1c..781772f 100644 --- a/src/app/api/ice/route.ts +++ b/src/app/api/ice/route.ts @@ -3,11 +3,12 @@ import crypto from 'crypto' import { setTurnCredentials } from '../../../coturn' const turnHost = process.env.TURN_HOST || '127.0.0.1' +const stunServer = process.env.STUN_SERVER || 'stun:stun.l.google.com:19302' export async function POST(): Promise { if (!process.env.COTURN_ENABLED) { return NextResponse.json({ - iceServers: [{ urls: 'stun:stun.l.google.com:19302' }], + iceServers: [{ urls: stunServer }], }) } @@ -21,7 +22,7 @@ export async function POST(): Promise { return NextResponse.json({ iceServers: [ - { urls: 'stun:stun.l.google.com:19302' }, + { urls: stunServer }, { urls: [`turn:${turnHost}:3478`, `turns:${turnHost}:5349`], username,