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

相关推荐
ascarl201011 小时前
记录一下es节点掉线后修复好了的情况
运维·jenkins
阿巴~阿巴~11 小时前
JsonCpp:C++ JSON处理利器
linux·网络·c++·json·tcp·序列化和反序列化
j***294811 小时前
IPV6公网暴露下的OPENWRT防火墙安全设置(只允许访问局域网中指定服务器指定端口其余拒绝)
服务器·安全·php
ao_lang11 小时前
数据链路层
linux·服务器·网络
safestar201211 小时前
Elasticsearch深度实战:从分布式原理到生产环境踩坑全记录
运维·搜索引擎·全文检索·es
z***33512 小时前
【MySQL系列文章】Linux环境下安装部署MySQL
linux·mysql·adb
额呃呃12 小时前
零拷贝I/O的核心概念
服务器·php·apache
偶像你挑的噻12 小时前
13-Linux驱动开发-中断子系统
linux·驱动开发·stm32·嵌入式硬件
小兔薯了13 小时前
7. LNMP-wordpress
android·运维·服务器·数据库·nginx·php
福尔摩斯张13 小时前
Linux进程间通信(IPC)机制深度解析与实践指南
linux·运维·服务器·数据结构·c++·算法