gpt4 book ai didi

webrtc - "iceConnectionState"是 "failed"没有任何错误

转载 作者:行者123 更新时间:2023-12-05 03:07:18 26 4
gpt4 key购买 nike

浏览器:Chrome 62.0.3202.94(64 位)

操作系统: Ubuntu 16.04

我正在尝试创建数据连接。几个月前我已经用这段代码完成了这个,但现在我不能完全让它工作。问题是,当我用 answer 调用 pc.setRemoteDescription 时,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 候选的方法——trickle 方式和 non-trickle 方式。这是他们如何解释 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/PxGIi2N1zswCgYIKoZIzj0EAwIwETEPMA0GA1UEAwwGV2ViUlRDMB4XDTE3MTIxODE0MTAxNVoXDTE4MDExODE0MTAxNVowETEPMA0GA1UEAwwGV2ViUlRDMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEcKm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nEJbmRHZ4enDYDUYsDWfz47DEtsSIqCCvvqIWzAKBggqhkjOPQQDAgNHADBEAiABuB2RUnFUFAAUetxwyLYwr9+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 failed, add a TURN server and see about:webrtc for more details

我测试过的两台机器都可以访问 Stun 服务器 here ,所以候选生成没有问题。我不确定它是否相关,但答案的 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

我错过了什么?

最佳答案

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

关于webrtc - "iceConnectionState"是 "failed"没有任何错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47871943/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com