Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Installing and configuring the TURN server on CentOS 7

1. Download and install turnserver

...

Code Block
languagebash
themeRDark
fingerprint
lt-cred-mech
user=username1:password1
realm=flashphoner.com
cert=/usr/local/etc/turn_server_cert.pem
pkey=/usr/local/etc/turn_server_pkey.pem
pkey-pwd=qweasd

аa) As seen from this example, operation of the TURN server requires a certificate and a private key.

...

Code Block
languagebash
themeRDark
openssl req -x509 -newkey rsa:4096 -keyout /usr/local/etc/turn_server_pkey.pem -out usr/local/etc/turn_server_cert.pem -days 365

бb) REQUIRED: the configuration file of the TURN server must enable authorization, and users for authorization must be specified (the first three lines of the configuration file example).

...

Code Block
languagebash
themeRDark
turnserver 

Connection using the TURN server

When you create a session using the Flashphoner API you need to pass the mediaOptions parameter where the coordinates of the TURN server are specified. Below is an example of creating such a session:

Code Block
languagebash
themeRDark
Flashphoner.createSession({urlServer: url, mediaOptions: {"iceServers": [ { 'url': 'turn:192.168.0.1:3478?transport=tcp', 'credential': 'password1', 'username': 'username1' } ], "iceTransportPolicy": "relay"}})

Known issues

1) The Microsoft Edge browser does not play streams via the TURN server

Solution: use another browser, because Microsoft Edge does not support TURN via TCP