【问题标题】:Connecting to self-hosted PeerJS Server - Angular连接到自托管 PeerJS 服务器 - Angular
【发布时间】:2017-11-21 02:51:16
【问题描述】:

我正在尝试连接到托管在 Heroku 上的 peerServer。我使用了 PeerJs 的“云” peerServer 提供程序,并且我的连接正常,但是,我需要自己的 ssl 服务器。据我了解,我的 peerServer 工作正常。 ->https://asphericpeerjs.herokuapp.com/

我已经根据 peerjs API 文档修改了代码,但是,根据 chrome 控制台,它仍在调用 http://0.peerjs.com/.../ect/ect...

this.peer = new Peer([], [{ host : 'https://asphericpeerjs.herokuapp.com' }]);
        setTimeout(() => {
            this.mypeerid = this.peer.id;
        }, 3000);

谢谢, 韦斯

【问题讨论】:

    标签: angular heroku webrtc peerjs


    【解决方案1】:

    数组不是必需的,这样做:

    this.peer = new Peer({ host : 'https://asphericpeerjs.herokuapp.com' });
            setTimeout(() => {
                this.mypeerid = this.peer.id;
            }, 3000);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-07-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-01
      • 2017-11-21
      • 2023-01-03
      • 1970-01-01
      相关资源
      最近更新 更多