Linux中搭建coturn服务器

1、下载coturn源码

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、服务器配置

#与前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服务

turnserver -v -r xxx.xxx.xxx.xxx(公网ip):3478 -a -o -c turnserver.conf

6、查看是否启动

sudo lsof -i:3478

7、关闭STURN服务

kill -9 <pid>

8、测试

Trickle ICE (webrtc.github.io)

在这里插入图片描述

参考链接:https://blog.csdn.net/lepaitianshi/article/details/123778506

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值