Force TURN relay mode to bypass NAT hairpinning

Added iceTransportPolicy: 'relay' to RTC_CONFIG to force TURN relay usage.
This bypasses NAT hairpinning issues when testing on the same network
(e.g., two browser tabs on the same machine).

This setting ensures maximum compatibility and reliability for WebRTC
connections by always using the TURN relay instead of attempting direct
or STUN-based connections.

Note: Should be commented out in production to allow direct connections
when possible for better performance.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-06 13:49:52 +01:00
parent 66dc35c1a7
commit b3dde85cd2

View File

@@ -15,7 +15,10 @@ const RTC_CONFIG = {
username: "webrtcuser",
credential: "supersecretpassword"
}
]
],
// Force TURN relay to bypass NAT hairpinning (when testing on same network)
// Comment out for production to allow direct connections when possible
iceTransportPolicy: 'relay'
};
export default function App() {