improve WebRTC NAT reliability diagnostics
Build and Publish / Metadata (push) Successful in 3s
Build and Publish / BuildAndDeployAmd64 (push) Successful in 29s

This commit is contained in:
mats committed 2026-09-22 16:31:21 +02:00
1 parent f3c735b808
commit 365415740e
5 files changed
+104 -11

No files matched your search

+7 -2
View File
@@ -24,6 +24,7 @@ const STATIC_DIR = fs.existsSync(path.join(__dirname, 'dist'))
// STUN_URLS comma-separated stun: urls
// TURN_URLS comma-separated turn:/turns: urls
// TURN_USERNAME / TURN_CREDENTIAL static creds for all TURN urls
// ICE_TRANSPORT_POLICY optional WebRTC policy (all, relay, or none)
// TURN_LAN_HOST / TURN_LAN_SECRET optional second, LAN-only TURN relay
// (own coturn instance + secret, reachable only from
// the local network via its own LoadBalancer IP with
@@ -85,7 +86,12 @@ function iceConfig() {
});
}
}
return { iceServers };
const config = { iceServers };
const iceTransportPolicy = process.env.ICE_TRANSPORT_POLICY;
if (iceTransportPolicy && ['all', 'relay', 'none'].includes(iceTransportPolicy)) {
config.iceTransportPolicy = iceTransportPolicy;
}
return config;
}
// ---------------------------------------------------------------------------
@@ -323,4 +329,3 @@ if (require.main === module) {
module.exports = { server, wss, iceConfig, allRoomsSnapshot, interval, startServer };