" iceConnectionState"是"失败"没有任何错误

时间:2017-12-18 15:52:18

标签: webrtc sdp peer-connection

浏览器: Chrome 62.0.3202.94,(64位)

操作系统: Ubuntu 16.04

我正在尝试创建数据连接。我几个月前使用此代码完成了这项工作,但现在我无法完成它。问题是当我使用pc.setRemoteDescription致电answer时,iceConnectionStatenew转到checking然后转到failed状态,没有任何反应之后(Chrome到Chrome连接)

当我在一台机器上运行此代码(两个单独的浏览器选项卡)时,一切正常。因此,当两个端点位于同一网络上时,没有问题。

这是连接卡住时的快照(不同网络中的端点):

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

优惠

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

答案:

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

以下代码:

处理ICE候选人有两种方法 - 涓流方式和非涓流方式。以下是他们differ的解释。基本上,以非涓流的方式,ICE候选人不会单独发送,而是聚集在一起,并在一个包中发送提议/答案。我在这里使用非涓流方法。

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)
}

这是来自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/PxGIi2N1zswCgYIKoZIzj0EAwIwETEPMA0GA1UEAwwGV2ViUlRDMB4XDTE3MTIxODE0MTAxNVoXDTE4MDExODE0MTAxNVowETEPMA0GA1UEAwwGV2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cKmntD/j3C7fLzVlUZxQU72eEKOUxMvWrqwul+iIJhUppEGgnEJbmRHZ4enDYDUYsDWfz47DEtsSIqCCvvqIWzAKBggqhkjOPQQDAgNHADBEAiABuB2RUnFUFAAUetxwyLYwr9+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"
}

修改

当我在Chrome和Firefox之间建立连接时,我收到错误(在Firefox中):

  

ICE失败,添加TURN服务器并查看:webrtc了解更多详情

可以从我测试它的两台机器here访问Stun服务器,因此候选生成没有问题。 我不确定它是否相关,但在答案的srflx个候选端口不匹配(24239!== 53848)。这是正常的吗?

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

我错过了什么?

1 个答案:

答案 0 :(得分:1)

我发现在处理收到的报价之前有时会发出信号接收候选人,这会使iceConnectionState失败。您没有使用addIceCandidate提供部分代码,因此它只是假设,但您可以尝试在addIceCandidate代码之前添加超时。