-
Notifications
You must be signed in to change notification settings - Fork 1
ICE Guide
ICE (Interactive Connectivity Establishment) is a framework used in WebRTC and VoIP systems to establish connections between peers, even when they are behind NAT (Network Address Translation) or firewalls. It uses two key components:
- STUN (Session Traversal Utilities for NAT) servers help clients discover their public IP and port by acting as an intermediary, enabling peers to communicate directly when possible.
- TURN (Traversal Using Relays around NAT) servers provide a fallback mechanism when direct communication isn't possible due to restrictive NAT or firewall configurations, relaying data between peers.
By combining STUN and TURN, ICE tests various connectivity paths and selects the most efficient one, optimizing communication and ensuring connectivity in challenging network conditions.
Coturn provides both STUN and TURN functionality. Setup a server with Coturn according to their docs. The following example configuration should work with Fudge.
/etc/turnserver.conf:
fingerprint
lt-cred-mech
user=test:Something!193
server-name=<insert proper FQDN for this server>
realm=fudge
simple-log
log-file=/var/log/turn/turnserver.log
proc-user=turnserver
proc-group=turnserver
listening-port=3478
tls-listening-port=5349
On the same or a different server setup Node.js and Fudge. Additionally you need server certificates, one of the easiest sources is Let's Encrypt.
Use Test/Net/Server/Server.ts but pass the certificate and private key to server.startUp(..)
.
Start up the server with node Server.js 17640
.
Edit Source/Net/Client/RtcConnection.ts and add the STUN/TURN-Server.
Now you can test the connection with Test/Net/Client/index.html