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

相关推荐
菜的不敢吱声4 小时前
swift学习第4天
服务器·学习·swift
晚枫歌F7 小时前
Dpdk介绍
linux·服务器
TH_17 小时前
35、AI自动化技术与职业变革探讨
运维·人工智能·自动化
风送雨8 小时前
FastMCP 2.0 服务端开发教学文档(下)
服务器·前端·网络·人工智能·python·ai
model20059 小时前
alibaba linux3 系统盘网站迁移数据盘
java·服务器·前端
yuhaiqun19899 小时前
学服务器训练AI模型:5步路径助力高效入门
运维·服务器·人工智能·笔记·机器学习·ai
huaweichenai9 小时前
docker部署kkFileView实现文件预览功能
运维·docker·容器
以太浮标9 小时前
华为eNSP模拟器综合实验之-BFD联动配置解析
运维·网络·华为·信息与通信
阿杰 AJie9 小时前
主流传输 /通信协议的【使用场景 + 详细使用说明】大全
服务器·tcp/ip
工程师老罗10 小时前
龙芯2k0300 PMON取消Linux自启动
linux·运维·服务器