【问题标题】:iceConnectionState is disconnected - VP9 Coded is null - PeerServericeConnectionState 已断开连接 - VP9 编码为空 - PeerServer
【发布时间】:2016-11-14 18:56:06
【问题描述】:

我有一个使用PeerJS 进行视频流传输的应用程序,并且我正在使用基于节点的Peer Server 通过HTTPS(安装在服务器上的SSL 证书)在Ubuntu 服务器实例上运行。

这就是我实例化 PeerServer 的方式:

var server = PeerServer({
port:55127,
path:'/',
debug:true,
ssl:{
    key: fs.readFileSync('/etc/apache2/ssl/mykey.key'),
    cert: fs.readFileSync('/etc/apache2/ssl/mycert.crt')
    }
});

这就是我创建对等连接的方式:

var peer = new Peer('peerHost',{host: 'myhost.com', port: 55127, path: '/'})

关于端口,我在 UFW 和路由器中都允许 55127。

出于某种奇怪的原因,我的对等连接和视频流在 LAN 中运行良好,但在互联网上出现故障 - 尽管有时它们可​​以正常工作,例如在 3G 移动网络上。

在调试 Peer 连接时,我偶然发现了这些“错误”:

PeerJS: VP9 Codec: null    
PeerJS:  iceConnectionState is disconnected, closing connections to (...)

服务器端没有错误,所有这些都在主机或客户端。

此问题类似于thisthisthis

有没有人知道可能出了什么问题以及如何解决?

提前致谢。

【问题讨论】:

    标签: javascript ssl webrtc peerjs


    【解决方案1】:

    好的,我似乎遇到了this 问题,在任何家用路由器中,一个非常常见的 NAT/防火墙场景会阻止我的 PeerJS 服务器需要访问的端口,从而禁止代理连接,并且不允许视频流式传输。

    解决方案是使用中间 TURN 服务器来覆盖 NAT 设置。

    var peer = new Peer({host: 'host.com', port: 55127, path: '/', debug:true, config: {'iceServers': [{ url: 'stun:stun.l.google.com:19302' },{ url: 'turn:numb.viagenie.ca', username: 'username@gmail.com', credential: 'password' }]}});
    

    【讨论】:

      猜你喜欢
      • 2023-02-14
      • 1970-01-01
      • 1970-01-01
      • 2019-04-22
      • 1970-01-01
      • 2013-12-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多