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 小时前
工作流的常见模式 [ 1 ]
java·服务器·前端
米高梅狮子4 小时前
第2章 docker容器
运维·docker·云原生·容器·架构·kubernetes·自动化
kidwjb5 小时前
信号量在进程中的使用
linux·进程间通信
闵孚龙5 小时前
Claude Code Ultraplan 远程多代理规划全解析:AI Agent、CCR远程容器、异步规划、状态机、计划传送与企业级自动化治理
运维·人工智能·自动化
南京码讯光电技术有限公司6 小时前
工业无线AP选型指南:从WiFi 5到WiFi 6+5G CPE,如何构建全覆盖、零漫游、高可靠的智能工厂网络?
服务器·网络·5g
sulikey6 小时前
个人Linux操作系统学习笔记2 - gcc与库的理解
linux·笔记·学习·操作系统·gcc·
二宝哥7 小时前
Linux虚拟机网络配置
linux·运维·服务器
卧室小白7 小时前
docker网络与服务编排与集群
运维·docker·容器
陳10307 小时前
Linux:进程间通信 和 简单进程池
linux·运维·服务器
数字化顾问7 小时前
(122页PPT)数字化架构的演进和治理(附下载方式)
java·运维·架构