Centos7 turn penetrate the building services

One: Download compile and install coturn
mkdir WLx
cd WLx
git clone https://github.com/coturn/coturn.git
cd coturn
./configure
the make
the make install
to see if the installation was successful which turnserver
II: solve error
2.1 OpenSSL error
perform the installation yum - the install OpenSSL devel-Y
2.2 Libevent2 error
download libevent install
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
the tar-2.0.21-stable.tar.gz zxvf libevent
the libevent the stable-2.0.21-CD && ./configure
the make the make the install &&
III: profile
3.1 with a turnserver.conf.default under / usr / local / etc / directory, copying of turnserver.conf
CD / usr / local / etc /
cp turnserver.conf.default turnserver.conf
3.2 cert and self-signed certificate generated by Openssl pkey configuration commands, generated two files in the / etc / directory
openssl req -x509 -newkey rsa: 2048 -keyout /etc/turn_server_pkey.pem -out /etc/turn_server_cert.pem 99999 -nodes -days
3.3 modify the configuration information (file content is too long, or edit it using Notepad ++ to download under)
vi /usr/local/etc/turnserver.conf
Listening and relay-ip-ip using network ip, external- ip ip is outside the network, configuration is as follows (related to IP user name or something to be replaced with your own)
Relay-Device = eth0 # ifconfig found the front of the card name consistent
listening-ip = 172.31.156.145 # internal network IP
Listening = 3478 -port
TLS-Port = 5349 Listening-
Relay-IP = 172.31.156.145
External IP = 47.105.104.4 #-public network the IP
Relay Threads = 50-
lt-mech the cred-
CERT = / etc / turn_server_cert.pem
PKey = / etc / turn_server_pkey.pem
PidFile = "/ var / RUN / turnserver.pid"
min-Port = 49152
max-Port = 65535
the User = WLx: 123456 # username and password, when you create IceServer with
cli-password = qwerty # is not open will be reported CONFIG ERROR:! Empty cli-password , and so telnet cli interface is disabled Please set a non empty cli-password! error

	#创建IceServer
	IceServer turnIceServer = new IceServer("turn:47.105.104.4:3478","wlx","123456");
	IceServer stunIceServer = new IceServer("stun:47.105.104.4:19302","","");
3.4 启动
turnserver -o -a -f -user=wlx:123456 -r Guangdong
3.5 关闭防火墙
            启动: systemctl start firewalld
	关闭: systemctl stop firewalld
	查看状态: systemctl status firewalld 
	开机禁用  : systemctl disable firewalld
	开机启用  : systemctl enable firewalld

Four: Test
test address: https: //webrtc.github.io/samples/src/content/peerconnection/trickle-ice/

Released four original articles · won praise 3 · Views 2460

Guess you like

Origin blog.csdn.net/ZQ960214/article/details/104773180