peerjs/webrtc iceConnectionState failed

2019-02-24 03:26发布

问题:

I've been trying to figure this out for a while. I'm trying to establish a simple connection using peerjs. I can connect successfully to the peer with id USER_ID. However, they are unable unable to connect to me. I receive the following log when they try to connect.

iceConnectionState is changed to failed eventually and no data can be recieved.

  • The application is using the peerjs cloud server
  • I'm using the latest version of Chrome. They have tried using latest versions of Chrome and Firefox
  • They have switched off any firewalls
  • Have even tried the peerjs chat example and it fails with the same error.

Any idea why this might happen / going on here?

Any help appreciated!

peer.min.js:1 PeerJS:  Socket open
peer.min.js:1 PeerJS:  Creating RTCPeerConnection.
peer.min.js:1 PeerJS:  Listening for ICE candidates.
peer.min.js:1 PeerJS:  Listening for `negotiationneeded`
peer.min.js:1 PeerJS:  Listening for data channel
peer.min.js:1 PeerJS:  Listening for remote stream
peer.min.js:1 PeerJS:  Setting remote description RTCSessionDescription
peer.min.js:1 PeerJS:  Added ICE candidate for: USER_ID
peer.min.js:1 PeerJS:  Set remoteDescription: OFFER for: USER_ID
peer.min.js:1 PeerJS:  Created answer.
peer.min.js:1 PeerJS:  Set localDescription: answer for: USER_ID
peer.min.js:1 PeerJS:  Received ICE candidates for: USER_ID
peer.min.js:1 PeerJS:  Added ICE candidate for: USER_ID
peer.min.js:1 PeerJS:  Received ICE candidates for: USER_ID
peer.min.js:1 PeerJS:  Added ICE candidate for: USER_ID
peer.min.js:1 PeerJS:  Received ICE candidates for: USER_ID
peer.min.js:1 PeerJS:  iceConnectionState is disconnected, closing connections to USER_ID