更多内容 https://www.webrtc-experiment.com/docs/TURN-server-installation-guide.html#centos
从 http://turnserver.open-sys.org/downloads/ 下载最新版对应你的操作系统的Turnserver 服务器安装包
下载后解压 使用以下命令安装 rpm包
rpm -ivh turnserver-xxxx.rpm
如遇缺少权限 使用 su root 输入密码即可
中途遇到缺少依赖包的问题,使用 yum insatall 安装相应的包即可
编辑配置文件
将extra 中的配置文件模版拷贝到/etc目录下,假设您的ip 是 1.2.3.4
1,配置文件
cp extra/turnserver.conf.template /etc/turnserver.conf
vi /etc/tunserver.conf
修改
listen_address = { "1.2.3.4" }
修改 ## Daemon mode.
daemon = true # 修改为后台服务方式
修改带宽限制
## 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,认证用户文件
cp extra/turnusers.txt.template /etc/turnusers.txt
'iceServers': [
{ 'url' : 'stun:1.2.3.4'} ,
{ 'url' : ‘turn:700@1.2.3.4',credential : '700pass'}
]
};