安装
编译安装
- 通过
git clone https://github.com/coturn/coturn.git
下载coturn
源码; - 执行
configure --prefix=/usr/local/coturn
指定安装目录,并生成Makefile
文件; - 执行
make -j 4
指定编译并发线程数为4
并执行编译; - 执行
make install
安装到/usr/local/coturn
目录;
配置文件位于安装目录下
源安装
- CentOS下执行
yum install coturn
- Ubuntu下执行
sudo apt install coturn
配置文件位于
/etc/coturn
下
配置
必须项目
listening-port=3478 # 指定侦听地址
external-ip=192.168.1.1 # (如果在云主机)指定云主机的公网IP地址
user=username:password # 访问stun/turn服务的用户名和密码
realm=stun.xxx.cn #域名,必须设置
使用
源代码安装方式,通过turnserver -c ./etc/turnserver.conf
启动coturn服务。
通过Trickle ICE可以测试coturn服务器是否搭建成功。
host地址:本机地址
srfix地址:映射后的地址
relay地址:中继地址
问题
- FreeSwitch和JsSip在局域网内测试无法使用