Coturn is an open-source project that provides a TURN and STUN server implementation. Both TURN and STUN are protocols that help in NAT traversal for WebRTC applications.

Coturn setup can be achieve in different mode, we assume that we are installing on same server than Backend, but it's strongly recommanded to install on different server.

apt install coturn

Now adjust the file /etc/turnserver.conf like this.

# Enable only if your server is behind a NAT.
external-ip=<you machine ip>

# Adjust only if you want to use another port.
listening-port=3478

# Ensure to enable fingerprint and long term credential.
fingerprint
lt-cred-mech

# Adjust the port range that turn is allowed to use. The port range must be opened from the
# firewall as UDP and TCP.
max-port=65535
min-port=49152

# Choose a realm, can be formatted like iabsis.com
realm=<domain>

# Configure a user and a password, this is required to be
# allowed to use the turn relay capabilities. <user>:<password>
user=myuser:mypass

If you don't want to put clear password in configuration file, you can encode the password with the following command.

turnadmin -k -u <user> -r <realm> -p <pass>

This command returns an encoded password starting by 0xabc..., replace mypass by the returned value, ensure to keep 0x in front of the password.

user=myuser:0xabc...

Keep in mind this user and password configured here as it will be used later by Mediasoup server.

Rating
0 0

There are no comments for now.

to be the first to leave a comment.