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

相关推荐
路弥行至2 分钟前
将你的 Jetson 变为全功能公网服务器——使用Cloudflare_Tunnel方式实现
运维·服务器·经验分享·笔记·其他·jetson·入门教程
Birdy_x3 分钟前
接口自动化项目实战(3):YAML读取+登录获取Token +YAML写入
运维·自动化·测试用例
heimeiyingwang5 分钟前
【架构实战】负载均衡架构:从四层到七层
运维·架构·负载均衡
信创DevOps先锋6 分钟前
本土化与安全合规双轮驱动:中国企业DevOps工具链选型趋势深度分析
运维·安全·devops
逆向编程6 分钟前
Ubuntu 入门教程:从安装到日常使用,新手一步到位
linux·运维·ubuntu
叠叠乐7 分钟前
ubuntu linux DNS 系统流程逻辑
linux·运维·ubuntu
果果燕7 分钟前
多路IO学习笔记
服务器·数据库
西西弗Sisyphus17 分钟前
Linux Shell 脚本中的 Shebang(#! /bin/bash)是什么
linux·bash·shebang
m0_6125919717 分钟前
尚航科技:从传统IDC服务商到智算中心(AIDC)引领者的转型之路
运维·数据中心·idc
ZKNOW甄知科技19 分钟前
展会回顾 | 甄知科技携燕千云·智能服务流平台亮相武汉
大数据·运维·人工智能·科技·安全·低代码·信息可视化