webrtc turn服务器搭建

测试环境ubuntu 22LTS

首先从github上下载源码编译 GitHub - coturn/coturn: coturn TURN server project

用的tag docker/4.6.2-r7

./configure --prefix =/usr/local/coturn

复制代码
make

安装coturn的时候还需要安装一些依赖包

apt-get install pkg-config

apt-get install openssl

然后修改coturn 下etc下的配置文件

主要内容

cpp 复制代码
listening-device=eth0
listening-ip=xxxx //云服务器内网ip
listening-port=3478
tls-listening-port=5349
relay-device=eth0
relay-ip=x.x.x.x //云服务器内网ip
min-port=49152
max-port=65535
external-ip=x.x.x.x //云服务器外网ip
fingerprint
lt-cred-mech
realm=voicevison.com
#userdb=/var/lib/turn/turndb
user=denghg:123456 #用户名密码
stale-nonce
no-loopback-peers
no-multicast-peers
mobility
no-cli
cert=/etc/turn_server_cert.pem  证书注意放在/usr/local/etc目录下不然可能找不到
pkey=/etc/turn_server_pkey.pem

然后说一下生成证书的参数

sudo openssl req -x509 -newkey rsa:2048 -keyout turn_server_pkey.pem -out turn_server_cert.pem -days 99999 -nodes

这里会生成证书的公钥私钥

非常重要的一点启动turn服务器的时候要带上域名 还没验证过没有域名能不能用

turnserver -o -a -f -r 【voicevison.com】 -c /etc/turnserver.conf

关闭turn服务命令

killall turnserver

记得去阿里云开3478和5349的udp tcp端口

测试网址

Trickle ICE

测试内容

相关推荐
垆边人似月.6 小时前
Python中如何使用get函数实现频次查询
服务器·前端·python
小张成长计划..6 小时前
【Linux】27:日志
linux·运维·服务器
时间售卖铺6 小时前
Nginx 反向代理
运维·nginx·云原生
life码农6 小时前
Nginx location 优先级详解:匹配规则、修饰符与完整代码示例
运维·nginx
我命由我123457 小时前
Python 开发 - Python 虚拟环境
运维·开发语言·后端·python·http·https·java-ee
dlhto7 小时前
Windows 使用 Rufus 制作 AlmaLinux 10.2 启动 U 盘:从 ISO 下载到服务器安装
运维·服务器·windows
软件派7 小时前
Beam.Win 自动化办公与业务流程提效指南
运维·自动化
澜山奕秋8 小时前
Rhcsa 二
linux·运维·服务器
2301_777998348 小时前
Linux 网络:数据链路层
linux·服务器·网络
无足鸟ICT8 小时前
【RHCA+】yum源配置(软件仓库)
linux·运维