错误网:: ERR_TUNNEL_CONNECTION_FAILED

时间:2018-03-07 12:47:09

标签: javascript connection peer

我使用peer开发了一个通信程序,如下脚本.js

$(function(){
  var messages = [];
  var peer_id, name, conn;
  var messages_template = Handlebars.compile($('#messages-template').html());
  var peer = new Peer({
    host: '187.84.228.139',
    port: 9000,
    path: '/peerjs',
    debug: 3,
    config: {'iceServers': [
    { url: 'stun:stun1.l.google.com:19302' },
    { url: 'turn:numb.viagenie.ca',
      credential: 'muazkh', username: 'webrtc@live.com' }
    ]}
  });
  peer.on('open', function(){
    $('#id').text(peer.id);
  });
})

但是在获取ID时,会出现以下消息:

Failed to load 187.84.228.139:9000/peerjs/peerjs/id?ts=15204245707800.6806042256269524 resource: net::ERR_TUNNEL_CONNECTION_FAILED
peer.js:1476 PeerJS:  ERROR Error retrieving ID undefined
peer.js:1476 PeerJS:  ERROR Aborting!
peer.js:1476 PeerJS:  ERROR Error: Could not get an ID from the server.
peer.js:1476 PeerJS:  ERROR Error retrieving ID ProgressEvent {isTrusted: true, lengthComputable: false, loaded: 0, total: 0, type: "error", …}
peer.js:1476 PeerJS:  ERROR Aborting!
peer.js:1476 PeerJS:  ERROR Error: Could not get an ID from the server.

发生了什么事?我该如何解决这个问题?

0 个答案:

没有答案