Linux中搭建coturn服务器

1、下载coturn源码

cpp 复制代码
git clone https://github.com/coturn/coturn.git

2、进入到coturn路径下,执行一下命令。

复制代码
./configure

出现以下错误:

问题1:ERROR: OpenSSL Crypto development libraries are not installed properly in required location.

解决办法:sudo apt-get install libssl-dev 执行此命令安装libssl

问题2:Libevent2 development libraries are not installed properly in required location.

解决办法:sudo apt-get install libssl-dev libevent-dev

出现以下界面说明./configure执行成功。

3、执行make,进行编译。出现以下界面则编译成功。

3、执行make install 安装。出现以下界面则安装成功。

4、服务器配置

cpp 复制代码
#与前ifconfig查到的网卡名称一致(如果无法运行ifconfig,可以在windows的cmd窗口中使用ipconfig,如果只有一块网卡,可以默认使用如下值)
relay-device=eth0
#内网IP(ipconfig查到的IP地址)
listening-ip=192.168.1.188
#公网IP(局域网可以使用与上面相同的ip地址)
external-ip=113.119.27.xx
#第1步创建的用户名密码,创建IceServer时用
user=your_username:your_password
#一般与turnadmin创建用户时指定的realm一致
realm=xxx.com
#端口号
listening-port=3478
#不开启会报CONFIG ERROR: Empty cli-password, and so telnet cli interface is disabled! Please set a non empty cli-password!错误
cli-password=qwerty
cert=/etc/turn_server_cert.pem
pkey=/etc/turn_server_pkey.pem

8、部署STURN服务

cpp 复制代码
turnserver -v -r xxx.xxx.xxx.xxx(公网ip):3478 -a -o -c turnserver.conf

6、查看是否启动

cpp 复制代码
sudo lsof -i:3478

7、关闭STURN服务

cpp 复制代码
kill -9 <pid>

8、测试

Trickle ICE (webrtc.github.io)

参考链接:https://blog.csdn.net/lepaitianshi/article/details/123778506

相关推荐
eucalyptus-DE9 小时前
Nova 计算节点故障排查指南
服务器·openstack
志栋智能9 小时前
告别报告堆砌:超自动化巡检的智能分析与洞察
运维·服务器·网络·人工智能·自动化
xyy_4969 小时前
wsl-localhost
linux
linux修理工10 小时前
linux禁用root登录
linux
雅斯驰10 小时前
AES-128加密+滚动码认证:ATA5702W如何防御中继攻击与信号重放
运维·单片机·嵌入式硬件·物联网·自动化
网络与设备以及操作系统学习使用者11 小时前
直连路由优先级最高
运维·网络·学习·华为·智能路由器
goyeer11 小时前
【ITIL4】34服务实践 - 发布管理
运维·企业数字化·信息化·it管理·itil·it治理
小王C语言11 小时前
xshell免密登录
linux·运维·服务器
请输入蚊子11 小时前
《操作系统真象还原》 第十一章 用户进程
linux·操作系统·操作系统真像还原
Qt程序员12 小时前
网络 I/O 面试必考点:从多进程多线程到异步 I/O 与多路复用
linux·网络编程·多线程·epoll·网络io·阻塞io·io_uring