Service-Terminal:
System environment: centos 7.1
Basic environment installation:
yum install openssl
yum install openssl-devel
yum install libevent
yum install libevent-devel
g++ installation: yum install gcc-c++
Unzip turnserver-4.5.0.4.tar.gz (can be downloaded from the official website: http://turnserver.open-sys.org/downloads/)
tar -xvf turnserver-4.5.0.4.tar.gz
./configure
make
sudo make install
Create a new turn user:
ling username ling1234 password
sudo turnadmin -a -u ling -r north.gov -p ling1234
Server running: turnserver -L 183.60.237.65 -a -f -v --mobility -m 10 --user=ling:ling1234 -r north.gov
Client:
It can be written in java, js, c++, etc. Here is where js is written:
After importing the ice class library, configure it accordingly.
ice.setIceServers([{
urls: "stun:" + uid
}, {
urls: "turn:" + uid + ":3478?transport=udp",
username: "ling",
credential: "ling1234"
}, {
urls: "turn:" + uid + ":3478?transport=tdp",
username: "ling",
credential: "ling1234"
}]);