WebRTC: TURN server deployment and usage

The TURN server is a part of WebRTC environment that transmits media traffic between peers if a direct peer-to-peer connection is not available (for example due to firewall restrictions). 



When should you have it? 
- When you want to transmit WebRTC streams between any random points of the internet or have no information about the transmission routes.  
- When your WebRTC transmission is critical and the content should be delivered at any cost.

Deployment
There are a lot of TURN server installation packages. We have used a TurnServer from the SourceForge, but it's not a mandatory. You can use any other  TURN server in your environment. 

To deploy the TurnServer you need to: 

Usage
To use a TURN server you should specify the address and password by "turn_server" and  "turn_password" MWebRTC object properties.
Here is a syntax example: 
turn_server = turn:[email protected]:3478 
turn_password = password1 

Where: 
"turn" - service keyword
"user1" - the username
"medialooks.com:3478" - turn server address and port
"password1" - password

You can specify this parameter values it in 2 ways:
1) In a registry. This value will be used by default by all newly created  MWebRTC objects.    
[HKEY_CURRENT_USER\Software\Medialooks\WebRTC] 
turn_server = turn:[email protected]:3478
turn_password = password1

2) Using PropsSet method. This value will be used within the object's lifetime.
m_objWebRTC.PropsSet("turn_server", "turn:[email protected]:3478"); 
m_objWebRTC.PropsSet("turn_password", "password1");

Important!
TURN server consumes a lot of traffic and calculation power because it has to transmit the media content between the peers. Make sure that you have a powerful hardware and wide traffic bandwidth to manage this task.