it is easy to install in linux machines, not tried in other OSes.
simple way:
sudo apt-get install coturn
If you say no, I want the latest cutting edge, you can download source code from their downloads page in install it yourself, example:
sudo -i # ignore if you already in admin mode
apt-get update && apt-get install libssl-dev libevent-dev libhiredis-dev make -y # install the dependencies
wget -O turn.tar.gz http://turnserver.open-sys.org/downloads/v4.5.0.3/turnserver-4.5.0.3.tar.gz # Download the source tar
tar -zxvf turn.tar.gz # unzip
cd turnserver-*
./configure
make && make install
sample command for running TURN server:
sudo turnserver -a -o -v -n --no-dtls --no-tls -u test:test -r "someRealm"
command description:
- -a - Use long-term credentials mechanism
- -o - Run server process as daemon
- -v - 'Moderate' verbose mode.
- -n - no configuration file
- --no-dtls - Do not start DTLS listeners
- --no-tls - Do not start TLS listeners
- -u - user credentials to be used
- -r - default realm to be used, need for TURN REST API
check this wiki for more details and configurations.
now you can use the TURN server in your WebRTC application as:
var peerConnectionConfig = {
iceServers: [{
urls: YOUR_IP:3478,
username: 'test',
password: 'test'
}]
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…