Integrating WEBRTC app with own TURN SERVER

385 views
Skip to first unread message

Tomasz G

unread,
Jun 22, 2015, 1:38:13 AM6/22/15
to discuss...@googlegroups.com
Hi,

I am sure that the most people involved in the project are also involved in WEBRTC.
So I hope that experienced people will share their experience with me and others.

Simply, I am going run locally popular example of WEBRTC app:

And based on this example I am going build simple, but efficient video chat app.

The apprtc installed, and even works locally  without turn server ( "Same origin policy" don't allow use Google TURN server, which works only from  https://apprtc.appspot.comaccess-control-allow-origin:"https://apprtc.appspot.com").

But I know that in real internet world (nats and firewalls) I need turn server.

I knew about this project: https://code.google.com/p/rfc5766-turn-server/ from apprtc tutorials.
But some chinese guys (I am Polish :) give me link to https://code.google.com/p/coturn/ in this tutorial:

http://io.diveinedu.com/2015/02/02/%E7%AC%AC%E4%BA%94%E7%AB%A0-WebRTC%E7%9A%84iOS%E6%A1%86%E6%9E%B6%E7%BC%96%E8%AF%91.html

Tutorial unfortunatelly don't solve my all questions, and don't help me integrate my app with turnserver - maby because of translations :)

So I have questions to this community.
1. I see (source->Changes) that a both projects are developed parallel with the same people. So can you tell me what turnserver I should use;
  +https://code.google.com/p/rfc5766-turn-server/
  +https://code.google.com/p/coturn/ 
  +or somethink else.

I need simplicity and efficient. I am not too eager install heavy packages like java, node.... Of course I like Python and JavaScript :) So please advice me witch turn server I need too use.

2. Another great source about webrtc and turnservers is:
https://www.webrtc-experiment.com/docs/STUN-or-TURN.html

There are some mentions about STUN server. Hmm, I think good solution is use STUN and TURN for fallback. I think it is for advanced users, but maby somebody have done it. Please tell me what install, how configure servers and if is possible to configure apprtc app via this simple settings:

LOOPBACK_CLIENT_ID = 'LOOPBACK_CLIENT_ID'

TURN_URL_TEMPLATE = '%s/turn?username=%s&key=%s'
CEOD_KEY = '4080218913'

3. I am trying integrate my apprtc with coturn:
 +apprtc: http://localhost:8080/?wstls=false
 +coturn: http://localhost: 3478

and I have questions:

a) Do I need execute some turnadmin commands, which are described in INSTALL guide?
Or it will be enaugh to run turnserver from example:
my_name@my_machine:~/WEBRTC/turnserver-4.4.5.2/examples/scripts/restapi$ ./secure_relay_secret.sh

which contains:

if [ -d examples ] ; then
       cd examples
fi

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/:/usr/local/mysql/lib/
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/usr/local/lib/:/usr/local/mysql/lib/

PATH="./bin/:../bin/:../../bin/:${PATH}" turnserver -v --syslog -a -L 127.0.0.1 -L ::1 -E 127.0.0.1 -E ::1 --max-bps=3000000 -f -m 3 --min-port=32355 --max-port=65535 --use-auth-secret --static-auth-secret=logen --realm=north.gov --cert=turn_server_cert.pem --pkey=turn_server_pkey.pem --log-file=stdout -q 100 -Q 300 --cipher-list=ALL $@


b) When I open localhost: 3478 in browser I see: 
"
TURN Server 
use https connection for the admin session:

What uri is for rest API?
http://localhost:3478/turn.php from chinese tutorial show the same page
http://localhost:3478/turn from example apprtc TURN_URL_TEMPLATE show the same page

c) In rest API I need pass some parameters: username and key. Is it enough?
Will be enough to simply add extra -u switch to turnserver command? Need I some extra configurations?

d) How solve "Same origin policy"? I am not going experiment with the same ports and nginx, but simply set "access-control-allow-origin" header to turnserver response. How do it without nginx proxy? Or maby some others solutions?

e) Are some other important issues, which person running apprtc app and coturn server should know?

4. Are some other important issues? 

Christoffer Jansson

unread,
Jun 23, 2015, 5:32:19 AM6/23/15
to discuss...@googlegroups.com, akty...@gmail.com
Hi Tomasz,

Generally it's better if you split up your questions in multiple posts with very specific questions. This post is too large for people to dig into and analyze.

Also I bet if you search the discuss-webrtc@ mailing group and/or google.com for your specific questions you will find answers.

As an example, searching for turn server returns 600+ results on discuss-webrtc@.

/Chris

Tomasz G

unread,
Jun 23, 2015, 1:12:45 PM6/23/15
to discuss...@googlegroups.com, akty...@gmail.com
Thanks Christoffer for message.
Some answer are yet solved, so I will listen you and ask about some more difficult in new posts.
Before it tomorow I will deep my experience with coturn and apprtc.
Reply all
Reply to author
Forward
0 new messages