Turn server webrtc configuration assistance

2.9k views Asked by At

I am in the process of configuring a TURN server to work with SimpleRTC on CentOS6(I think).

This is the first time I am building webrtc services on centos. I have successfully installed this service on Ubuntu 64 bit Amazon EC2 instance. Unfortunately centos installation is a bit different, and I am slightly lost.

I have the Turn service installed and running. When navigating to my ip and listening port in the url, I see that my turn service is listening on that ip and port with this message from turnserver running -v flag.

445: IPv4. tcp or tls connected to: 173.57.xxx.xx:55676
445: IPv4. tcp or tls connected to: 173.57.xxx.xx:55677

The HTML of the page displays this message...
TURN Server

I am fairly certain that turnserver is setup properly because of this, but I think the ice connections are somehow screwed up.

Here is my ICE config.

This configuration resides in... latest.js, simplewebrtc.bundle.js, and simplewebrtc.js

{iceServers:[{url:"stun:stun.l.google.com:19302"},
    {    
    'url': 'turn:[email protected]:5349?transport=udp',    
    'credential': 'xxxxx'/*,    
    'username': 'mrturn:xxxxx'*/    
    },    
    {    
    'url': 'turn:[email protected]:5349?transport=tcp',    
    'credential': 'xxxx'/*,    
    'username': 'mrturn:xxxx'*/    
    }]} 

I have tried quite a few things here, but I cannot get the turn server to give any indication as to why this is not connecting. Obviously it would need to try and connect for some debugging to occur via turn server command line, but I just can't get there.

If anyone has any advice as to why this connection is not working please let me know. I will tip in bitcoin to any answer that resolves this issue.

2

There are 2 answers

1
Guy S On

Make sure the ports are open on your server (both TCP and UDP)

TURN runs on the same ports as STUN: 3478 for TURN over UDP and TCP, and 5349 for TURN over TLS. However, TURN has its own set of Service Record (SRV) names: "turn" for UDP and TCP, and "turns" for TLS.

So maybe try

{iceServers:[{url:"stun:stun.l.google.com:19302"},
    {    
    'url': 'turns:[email protected]:5349?transport=udp',    
    'credential': 'xxxxx'/*,    
    'username': 'mrturn:xxxxx'*/    
    },    
    {    
    'url': 'turns:[email protected]:5349?transport=tcp',    
    'credential': 'xxxx'/*,    
    'username': 'mrturn:xxxx'*/    
    }]}

If that doesn't work, maybe you can try to have the TURN server listen on 3478 (its default port).

hope this helps

Also the RFC5766-TURN-server group is a great place for questions regarding this project and usually answer pretty fast

0
spinicrus On

late, but try to put your turn service conf @ first position in the iceServers arr, as noted here: https://bloggeek.me/popexpert-interview/