If the webrtc service is only for testing within the local area network, you don’t need this, but if you want to put it on the external network, you need to build a turn service. Today, I tried to build
ubuntu14.04 on the server.
sudo apt-get install libssl-dev
sudo apt-get install libevent-dev
sudo apt-get install libpq-dev
sudo apt-get install mysql-client
sudo apt-get install libmysqlclient-dev
sudo apt-get install libhiredis-dev
sudo apt-get install git
sudo apt-get install make
Install coturn
git clone https://github.com/coturn/coturn
cd coturn/
./configure --prefix=/alidata/soft
make
sudo make install
In the middle, you will encounter that if there are dependencies that are not installed, you need to install the dependencies yourself
Start service
Here you need to understand the difference between stun and turn
https://developer.aliyun.com/article/243540
- turn
turnserver -o -v -f -a -m 2 --max-bps=100000 --min-port=32355 --max-port=65535 --user=phz:1 -r phzled.cn -L your.ip
- stun
turnserver -o -f -v -a -m 2 --max-bps=100000 --min-port=32355 --max-port=65535 --user=phz:1 -r phzled.cn -X <public ip/ private ip> -X <public ip/ private ip>
Parameter Description
-
-o run in daemon mode (run in background)
-
-v logs will be recorded at a "moderately detailed" level
-
-f Increase the fingerprint mechanism.
-
-a Long-term verification mechanism
-
-m Process relay requests with x processes
-
--Max-bps bandwidth
-
--Min-port The minimum port to start with
-
--Max-port maximum port number
-
--User=Account: Password (you can write anything you like, just remember, the user authentication mechanism of the turn service should be used)
-
-r field (whatever you want). If the turn server is not configured with any database/command line/conf file, you need to add this option and use it with long-term credentials (-a option)
-
-L Monitoring IP (the ip of the turn server) This ip is the ip found by your ifconfig, not your public network ip
-
-X is followed by public ip/ private ip and used in the case of multiple IPs. If there are several IPs, use it several times
Detection address
https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/
List of free stun services
stun:stun1.l.google.com:19302
stun:stun2.l.google.com:19302
stun:stun3.l.google.com:19302
stun:stun4.l.google.com:19302
stun:23.21.150.121
stun:stun01.sipphone.com
stun:stun.ekiga.net
stun:stun.fwdnet.net
stun:stun.ideasip.com
stun:stun.iptel.org
stun:stun.rixtelecom.se
stun:stun.schlund.de
stun:stunserver.org
stun:stun.softjoys.com
stun:stun.voiparound.com
stun:stun.voipbuster.com
stun:stun.voipstunt.com
stun:stun.voxgratia.org
stun:stun.xten.com
``