【问题标题】:How to config coturn on Nginx for webRTC?如何在 Nginx 上为 webRTC 配置 coturn?
【发布时间】:2020-11-10 08:15:48
【问题描述】:

我正在制作一个在 wifi 上运行良好的 WebRTC 应用程序。但是当我通过 4G 在手机上打开应用程序时,webRTC Livestream 将无法启动。制作 iceConnectionState 似乎出了点问题。

对于 Iceserver,我在我的 Nginx 服务器上使用 coturn 制作了一个转弯服务器,设置如下:

listening-port=3478
tls-listening-port=5349

listening-ip=my-public-ip
relay-ip=my-public-ip
external-ip=my-public-ip


fingerprint
user=Dominique:GS7Yq_jK
lt-cred-mech
server-name=domain.com
realm=domain.com
log-file=/var/log/turnserver/turnserver.log
simple-log
external-ip=my-public-ip

total-quota=100
stale-nonce=600

# Authentication method
use-auth-secret
static-auth-secret=33515e71ba1d0a96e77083f7e4215d99afe36204b6f382e1715fbb9314ae61d0

cert=/etc/letsencrypt/live/domain.com/fullchain.pem
pkey=/etc/letsencrypt/live/domain.com/privkey.pem

在我的 nginx.conf 中,我添加了以下代码块

stream {
        server {
                listen 3478 udp;
                proxy_pass domain.com:3478;
        }

        server {
                listen 5349 udp;
                proxy_pass domain.com:5349;
        }
}

当我通过 testing site 测试我的 Turn 服务器时

我通过这些设置得到这个结果

 urls: 'turn:domain.com:3478',
  username: 'Dominique',
  credential: 'GS7Yq_jK'

但我的轮到服务器似乎无法正常工作 有谁能帮助我吗?我想让 WebRTC 在 4G 上工作

感谢您的帮助!

Gr,多米尼克

【问题讨论】:

    标签: nginx webrtc coturn


    【解决方案1】:

    我在这个问题中找到了解决方案 :) 我添加了一个 /etc/nginx/conf.d/load-balancer.conf 然后转向服务器工作

    stackoverflow question

    【讨论】:

      猜你喜欢
      • 2015-10-19
      • 2019-05-29
      • 1970-01-01
      • 2021-10-28
      • 2014-08-24
      • 1970-01-01
      • 2020-12-26
      • 2013-07-24
      • 1970-01-01
      相关资源
      最近更新 更多