improve WebRTC NAT reliability diagnostics
This commit is contained in:
1 parent
f3c735b808
commit
365415740e
5 files changed
+104
-11
No files matched your search
@@ -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 };
|
||||
|
||||
|
||||
Reference in new issue
Block a user