云迈博客

您现在的位置是:首页 > 后端开发 > Linux > 正文

Linux

基于coturn的stun/turn服务器搭建

wsinbol2021-01-31Linux470
安装及编译˃mkdircoturncdcoturn/gitclonehttps://github.com/coturn/coturn.gitcdcoturn/./configure
  • 安装及编译

mkdir coturn
cd coturn/
git clone https://github.com/coturn/coturn.git
cd coturn/
./configure
make && make install
which turnserver
cd /usr/local/etc/
cp turnserver.conf.default turnserver.conf
vim turnserver.conf

  • 生成证书

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

  • 配置文件信息
listening-port=xxx
tls-listening-port=xxx
external-ip=xxx
lt-cred-mech
cert=/etc/turn_server_cert.pem
pkey=/etc/turn_server_pkey.pem
pidfile="/var/run/turnserver.pid"
min-port=49152
max-port=65535
user=xx:xx
cli-password=xxx
realm=xxx
  • 启动服务

turnserver -o -a -f -r stun.yunmell.com

  • 验证方式

检测ice穿透的在线工具,点此跳转!

  • stun 方式验证

  • turn 方式验证

发表评论

评论列表

  • 这篇文章还没有收到评论,赶紧来抢沙发吧~