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

相关推荐
Tutankaaa1 分钟前
从单场到多场并发:知识竞赛平台的弹性扩展能力
服务器·笔记·学习·职场和发展
实心儿儿3 分钟前
Linux —— 进程间通信 - 命名管道
linux·运维·服务器
funnycoffee1239 分钟前
Cisco Firewpower 4100 9300 FXOS change management ip address
linux·数据库·tcp/ip
Agent手记19 分钟前
多渠道订单数据处理自动化,落地步骤与ERP打通方案 | 2026企业级智能体实战手册
运维·人工智能·ai·自动化
呉師傅22 分钟前
统信UOS如何安装本地打印机驱动以及URL查找网络打印机并安装驱动方法
运维·服务器·网络·windows·电脑
iFlow_AI23 分钟前
构建自动化专属Paper库:用 Happy-Notes + iFlow-search-skill 搭建阅读写作流水线
运维·自动化·skill·心流·happy-notes
青梅橘子皮24 分钟前
Linux---开发工具(1)(vim,gcc/g++)
linux·运维·服务器
邮专薛之谦24 分钟前
Linux常用指令大全(完整版)
linux·运维·服务器
Ogcloud_oversea31 分钟前
SD-WAN 技术架构解析:控制平面与数据平面的解耦实践
运维·网络·网络协议·网络安全·信息与通信
jfqqqqq33 分钟前
记一次ubuntu 22.04安装旧版 MongoDB 4.2
linux·mongodb·ubuntu