当前位置: 移动技术网 > IT编程>数据库>Mysql > 阿里云服务器(Ubuntu18.04版本)中安装coturn穿透服务器

阿里云服务器(Ubuntu18.04版本)中安装coturn穿透服务器

2020年07月29日  | 移动技术网IT编程  | 我要评论

一、安装依赖库

sudo apt-get update 
sudo apt-get install libssl-dev libevent-dev libpq-dev mysql-client libmysqlclient-dev libhiredis-dev make -y
sudo apt-get install gdebi-core -y
sudo apt-get install sqlite libsqlite3-dev -y
sudo apt-get install git -y

二、下载源码并编译安装

git clone https://github.com/coturn/coturn
cd coturn
./configure --prefix=/usr/local/coturn
make && make install
cd /usr/local/coturn/etc/
cp turnserver.conf.default turnserver.conf

安装成功后:
在这里插入图片描述

三、coturn启动命令

nohup ./bin/turnserver --syslog -a -L 172.17.33.244 -X 47.93.25.18 -E 172.17.33.244 -f --min-port=30000 --max-port=31000 --user=helloworld:helloworld -r helloworld --cert=turn_server_cert.pem --pkey=turn_server_pkey.pm --log-file=stdout -v  > /usr/local/turn.log &

172.17.33.244为阿里云服务器内网IP,47.93.25.18为阿里云服务器外网IP(请自行修改)
min-port、max-port为开放的端口范围,在阿里云安全组中需要配置(请自行修改)
helloworld:helloworld -r helloworld为用户名、密码(请自行修改)

四、阿里云端口配置

注意:需要开通3478(coturn默认端口)、30000-31000端口(启动命令中配置的最小-最大端口),对应端口的tcp、udp都要配置
在这里插入图片描述

五、安装、配置完成后测试

//查看coturn是否启动
netstat -ntpl

在这里插入图片描述
此时仅说明服务器上启动成功,但还需要在网页上进行测试:

//访问该地址:
https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/
//输入自己配置的服务器地址、用户名、密码:
turn:47.93.25.18:3478 
helloworld 
helloworld
//点击Add Server后再点击Gather Cnadidates

在这里插入图片描述
在这里插入图片描述
注意:只有对应服务器上有relay映射回来才算搭建成功!!

本文地址:https://blog.csdn.net/qq_29928745/article/details/107642128

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网