Week 14. TURN Server

less than 1 minute read

Hello all!

This week I’ve been a bit more busy with the course beginning, but I’ve made some updates. While testing the Follow Line Game Synchronous on different subnets, appeared an issue, wich is that if the users are behind some types of NATs, the connection with only a STUN server won’t work. In order to solve this problem I read in many articles that in this cases a TURN server is needed.

Before deploying a TURN server in our test machine, I started by reading how the STUN protocol works and how a client communicates with the server (rfc5766). When I knew how the protocol worked, I started to deploy the server on our machine using coturn, an open-source TURN server developed in C Languaje. I got stuck many times while testing the server was working fine, but finally I solved every issue. This is the configuration I used to deploy the server in a Docker Container:

sudo docker run -d --network=host coturn/coturn -n --log-file=stdout --listening-port=20500 --listening-ip=212.128.254.32 --relay-ip=212.128.254.32 --user=danielhervas:danielhervas --lt-cred-mech --verbose --realm=test.unibotics.org