When deploying WEBRTC or SIP-to-peer scenarios, you will often encounter environments that are not penetrated by peer
This is where the tunserver comes in.
Here we use turnserver-0.7.3
Download confuse dependent libraries
wget http://savannah.nongnu.org/download/confuse/confuse-2.7.tar.gz
Tar zxvf confuse-2.7.tar.gz
CD confuse*
./configure
Make && make install
Download
wget http://downloads.sourceforge.net/project/turnserver/turnserver-0.7.3.tar.bz2
Tar jxvf turnserver-0.7.3.tar.bz2
CD turnserver*
./configure
Make && make install
Editing a configuration file
Copy the profile template from the extra to the/etc directory, assuming your IP is 1.2.3.4
1, configuration file
CP extra/turnserver.conf.template/etc/turnserver.conf
Vi/etc/tunserver.conf
Modify
Listen_address = {"1.2.3.4"}
Modify # # Daemon mode.
Daemon = true # Modify to background service mode
Modify Bandwidth Limits
# # Allocation Bandwidth limitation (in KBYTES/S).
# # 0 value means bandwidth quota disabled.
Bandwidth_per_allocation = 1024
# # Restricted User bandwidth (in kbytes/s).
# # 0 value means bandwidth limitation disabled.
Restricted_bandwidth = 0
2, Authenticated user files
CP Extra/turnusers.txt.template/etc/turnusers.txt
Vi/etc/turnusers.txt add one or more lines of authentication information in the format user name: password: domain:authorized For example, the following line: 700:700pass:domain.org:authorized after the add is complete, You can use stun and tun server in WEBRTC. var configuration = {
' Iceservers ': [{
{' URL ': ' stun:1.2.3.4 '},
{' URL ': ' Turn:[email protected] ', credential: ' 700pass '}
}]
};
Reprint Path: http://blog.163.com/sir_876/blog/static/11705223201422810528434/
Deploying turn Server for WEBRTC applications