"iceConnectionState" is "failed" without any error

9.6k views Asked by At

Browser: Chrome 62.0.3202.94, (64 bit)

OS: Ubuntu 16.04

I'm trying to create a data connection. I've done this before with this code a couple of months ago, but now I can't quite get it to work. The problem is that when I call pc.setRemoteDescription with an answer, iceConnectionState goes from new to checking and then to failed state and nothing happens after that (Chrome to Chrome connections)

When I run this code on a single machine (two separate browser tabs) everything works just fine. So, there's no problem when both endpoints are on the same network.

Here's a snapshot when connection is stuck (endpoints in different networks):

iceConnectionState: "failed"
iceGatheringState: "complete"
signalingState:"stable"

Offer:

v=0
o=- 2693235123136612430 3 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE data
a=msid-semantic: WMS
m=application 45251 DTLS/SCTP 5000
c=IN IP4 89.105.158.245
a=candidate:2795255774 1 udp 2122260223 192.168.1.7 45251 typ host generation 0 network-id 1 network-cost 10
a=candidate:264484875 1 udp 1686052607 89.105.158.245 45251 typ srflx raddr 192.168.1.7 rport 45251 generation 0 network-id 1 network-cost 10
a=candidate:3894397742 1 tcp 1518280447 192.168.1.7 9 typ host tcptype active generation 0 network-id 1 network-cost 10
a=ice-ufrag:t9xZ
a=ice-pwd:eqMc+d4DS9D/yWtM5um9jGzi
a=ice-options:trickle
a=fingerprint:sha-256 A2:8E:9B:D5:48:3F:46:A1:02:8B:42:AE:71:23:4E:68:27:CD:12:C5:2F:18:DA:64:86:08:E2:BA:19:30:1D:F4
a=setup:actpass
a=mid:data
a=sctpmap:5000 webrtc-datachannel 1024

Answer:

o=- 8717349184791425430 3 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE data
a=msid-semantic: WMS
m=application 24239 DTLS/SCTP 5000
c=IN IP4 145.255.177.124
b=AS:30
a=candidate:1019731727 1 udp 2122260223 192.168.1.104 53848 typ host generation 0 network-id 1 network-cost 10
a=candidate:1917068287 1 tcp 1518280447 192.168.1.104 9 typ host tcptype active generation 0 network-id 1 network-cost 10
a=candidate:3180321211 1 udp 1686052607 145.255.177.124 24239 typ srflx raddr 192.168.1.104 rport 53848 generation 0 network-id 1 network-cost 10
a=ice-ufrag:MkpV
a=ice-pwd:ziXJMu7r/UYnLx1srbUqkXp6
a=ice-options:trickle
a=fingerprint:sha-256 9D:2B:AB:D8:B4:65:5F:86:A6:2A:D8:D0:5A:54:D9:E1:81:B4:6F:21:A4:5D:36:FA:E0:D3:7F:0F:B2:10:8D:3E
a=setup:active
a=mid:data
a=sctpmap:5000 webrtc-datachannel 1024

Here's the code:

There are two approaches to handling ICE candidates — trickle way and non-trickle way. Here's the explanation of how they differ. Basically, in a non-trickle way ICE candidates are not sent out separately, but gathered together and sent out with an offer/answer in one package. I'm using the non-trickle approach here.

const signallingServerApi = {...} // api for sending/receiving messages
const iceServers = [ { urls: [ 'stun:stun.l.google.com:19302' ] } ]
let pc
let sdc

// INIT
const = call => () {
  createDataConnection()
  pc.createOffer()
    .then(pc.setLocalDescription)
}

// HELPERS
const createDataConnection = () => {
  pc = new window.RTCPeerConnection({ iceServers })
  pc.ondatachannel = onDataChannel
  pc.onicecandidate = onIceCandidate
  sdc = pc.createDataChannel('sdc')
}

// PC EVENTS HANDLERS
const onDataChannel = (event) => {
  rdc = event.channel
}
const onIceCandidate = (event) => {
  if (event.candidate) return
  const description = event.target.localDescription
  signallingServerApi.send(description)
}

// SIGNALLING SERVER API CALLBACKS
signallingServerApi.onOffer = (offer) => {
  createDataConnection()
  pc.setRemoteDescription(offer)
    .then(pc.createAnswer)
    .then(pc.setLocalDescription)
}
signallingServerApi.onAnswer = (answer) => {
  pc.setRemoteDescription(answer)
}

Here's a dump from chrome://webrtc-internals/

{
 "getUserMedia": [
  {
   "audio": "",
   "origin": "https://olmeo.us",
   "pid": 5535,
   "rid": 11,
   "video": ""
  }
 ],
 "PeerConnections": {
  "5535-1": {
   "constraints": "",
   "rtcConfiguration": "{ iceServers: [stun:stun.l.google.com:19302], iceTransportPolicy: all, bundlePolicy: balanced, rtcpMuxPolicy: require, iceCandidatePoolSize: 0 }",
   "stats": {
    "googLibjingleSession_579639950488086086-googInitiator": {
     "startTime": "2017-12-19T14:10:59.205Z",
     "endTime": "2017-12-19T14:11:18.194Z",
     "values": "[true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true]"
    },
    "bweforvideo-googActualEncBitrate": {
     "startTime": "2017-12-19T14:10:59.205Z",
     "endTime": "2017-12-19T14:11:18.194Z",
     "values": "[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]"
    },
    "bweforvideo-googAvailableReceiveBandwidth": {
     "startTime": "2017-12-19T14:10:59.205Z",
     "endTime": "2017-12-19T14:11:18.194Z",
     "values": "[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]"
    },
    "bweforvideo-googAvailableSendBandwidth": {
     "startTime": "2017-12-19T14:10:59.205Z",
     "endTime": "2017-12-19T14:11:18.194Z",
     "values": "[300000,300000,300000,300000,300000,300000,300000,300000,300000,300000,300000,300000,300000,300000,300000,300000,300000,300000,300000,300000]"
    },
    "bweforvideo-googBucketDelay": {
     "startTime": "2017-12-19T14:10:59.205Z",
     "endTime": "2017-12-19T14:11:18.194Z",
     "values": "[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]"
    },
    "bweforvideo-googRetransmitBitrate": {
     "startTime": "2017-12-19T14:10:59.205Z",
     "endTime": "2017-12-19T14:11:18.194Z",
     "values": "[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]"
    },
    "bweforvideo-googTargetEncBitrate": {
     "startTime": "2017-12-19T14:10:59.205Z",
     "endTime": "2017-12-19T14:11:18.194Z",
     "values": "[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]"
    },
    "bweforvideo-googTargetEncBitrateCorrected": {
     "startTime": "2017-12-19T14:10:59.205Z",
     "endTime": "2017-12-19T14:11:18.194Z",
     "values": "[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]"
    },
    "bweforvideo-googTransmitBitrate": {
     "startTime": "2017-12-19T14:10:59.205Z",
     "endTime": "2017-12-19T14:11:18.194Z",
     "values": "[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]"
    },
    "datachannel_-1-protocol": {
     "startTime": "2017-12-19T14:10:33.510Z",
     "endTime": "2017-12-19T14:10:33.510Z",
     "values": "[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]"
    },
    "datachannel_-1-state": {
     "startTime": "2017-12-19T14:10:33.510Z",
     "endTime": "2017-12-19T14:10:33.510Z",
     "values": "[\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\"]"
    },
    "datachannel_-1-label": {
     "startTime": "2017-12-19T14:10:33.510Z",
     "endTime": "2017-12-19T14:10:33.510Z",
     "values": "[\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\"]"
    },
    "googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F-googDerBase64": {
     "startTime": "2017-12-19T14:10:59.205Z",
     "endTime": "2017-12-19T14:11:18.194Z",
     "values": "[\"MIIBFTCBvaADAgECAgkA/PxGIi2N1zswCgYIKoZIzj0EAwIwETEPMA0GA1UEAwwGV2ViUlRDMB4XDTE3MTIxODE0MTAxNVoXDTE4MDExODE0MTAxNVowETEPMA0GA1UEAwwGV2ViUlRDMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQc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IJhUppEGgnEJbmRHZ4enDYDUYsDWfz47DEtsSIqCCvvqIWzAKBggqhkjOPQQDAgNHADBEAiABuB2RUnFUFAAUetxwyLYwr9+hMIuyvCcKpVtX4gkbDgIgSlRZD5NQETFAsm6XWQ2g904Zv4CTlXrbYsTp684NAw0=\",\"MIIBFTCBvaADAgECAgkA/PxGIi2N1zswCgYIKoZIzj0EAwIwETEPMA0GA1UEAwwGV2ViUlRDMB4XDTE3MTIxODE0MTAxNVoXDTE4MDExODE0MTAxNVowETEPMA0GA1UEAwwGV2ViUlRDMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEcKmntD/j3C7fLzVlUZxQU72eEKOUxMvWrqwul+iIJhUppEGgnEJbmRHZ4enDYDUYsDWfz47DEtsSIqCCvvqIWzAKBggqhkjOPQQDAgNHADBEAiABuB2RUnFUFAAUetxwyLYwr9+hMIuyvCcKpVtX4gkbDgIgSlRZD5NQETFAsm6XWQ2g904Zv4CTlXrbYsTp684NAw0=\",\"MIIBFTCBvaADAgECAgkA/PxGIi2N1zswCgYIKoZIzj0EAwIwETEPMA0GA1UEAwwGV2ViUlRDMB4XDTE3MTIxODE0MTAxNVoXDTE4MDExODE0MTAxNVowETEPMA0GA1UEAwwGV2ViUlRDMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEcKmntD/j3C7fLzVlUZxQU72eEKOUxMvWrqwul+iIJhUppEGgnEJbmRHZ4enDYDUYsDWfz47DEtsSIqCCvvqIWzAKBggqhkjOPQQDAgNHADBEAiABuB2RUnFUFAAUetxwyLYwr9+hMIuyvCcKpVtX4gkbDgIgSlRZD5NQETFAsm6XWQ2g904Zv4CTlXrbYsTp684NAw0=\"]"
    },
    "googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F-googFingerprint": {
     "startTime": "2017-12-19T14:10:59.205Z",
     "endTime": "2017-12-19T14:11:18.194Z",
     "values": "[\"CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"CB:62:2A:C7:75:C0:6B:1F:1f:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\"]"
    },
    "googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F-googFingerprintAlgorithm": {
     "startTime": "2017-12-19T14:10:59.205Z",
     "endTime": "2017-12-19T14:11:18.194Z",
     "values": "[\"sha-256\",\"sha-256\",\"sha-256\",\"sha-256\",\"sha-256\",\"sha-256\",\"sha-256\",\"sha-256\",\"sha-256\",\"sha-256\",\"sha-256\",\"sha-256\",\"sha-256\",\"sha-256\",\"sha-256\",\"sha-256\",\"sha-256\",\"sha-256\",\"sha-256\",\"sha-256\"]"
    },
    "Channel-data-1-googComponent": {
     "startTime": "2017-12-19T14:10:59.205Z",
     "endTime": "2017-12-19T14:11:18.194Z",
     "values": "[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]"
    },
    "Channel-data-1-localCertificateId": {
     "startTime": "2017-12-19T14:10:59.205Z",
     "endTime": "2017-12-19T14:11:18.194Z",
     "values": "[\"googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:4E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\",\"googCertificate_CB:62:2A:C7:75:C0:6B:1F:48:66:61:5C:FF:C1:00:9C:48:D0:8B:ED:6E:57:F9:FB:DB:4A:9A:85:1F:02:F1:4F\"]"
    },
    "datachannel_1-datachannelid": {
     "startTime": "2017-12-19T14:10:59.205Z",
     "endTime": "2017-12-19T14:11:18.194Z",
     "values": "[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]"
    },
    "datachannel_1-protocol": {
     "startTime": "2017-12-19T14:10:59.205Z",
     "endTime": "2017-12-19T14:11:18.194Z",
     "values": "[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]"
    },
    "datachannel_1-state": {
     "startTime": "2017-12-19T14:10:59.205Z",
     "endTime": "2017-12-19T14:11:18.194Z",
     "values": "[\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\",\"connecting\"]"
    },
    "datachannel_1-label": {
     "startTime": "2017-12-19T14:10:59.205Z",
     "endTime": "2017-12-19T14:11:18.194Z",
     "values": "[\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\",\"sdc\"]"
    }
   },
   "updateLog": [],
   "url": "https://olmeo.us/requests"
  }
 },[
 "UserAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36"
}

EDIT

When I make a connection between Chrome and Firefox I get an error(in Firefox):

ICE failed, add a TURN server and see about:webrtc for more details

Stun server is reachable from both machines I tested it here, so there's no problem with candidate generation. I'm not sure if it's relevant, but in answer's srflx candidate ports don't match (24239 !== 53848). Is it normal?

a=candidate:3180321211 1 udp 1686052607 145.255.177.124 24239 typ srflx raddr 192.168.1.104 rport 53848 generation 0 network-id 1 network-cost 10

What am I missing?

1

There are 1 answers

1
Argnist On

I've found that sometimes signalling receive candidates before handling received offer, and it makes iceConnectionState failed. You didn't provide part of code with addIceCandidate, so it's only assumption but you can try to add timeout before addIceCandidate code.