我的 webRTC 应用程序终于使用 node-turn 将我的 AT&T 手机连接到我的 wifi。它似乎工作得很好,但一分钟后它总是会改变对等方的状态,然后断开连接。这是日志中始终显示的内容
relaying data fromIPV4://97.121.170.121:60183 over channelNumber 16387 to IPV4://166.177.121.0:12273
relaying data fromIPV4://97.121.170.121:60183 over channelNumber 16387 to IPV4://166.177.121.0:12273
relaying data fromIPV4://97.121.170.121:60183 over channelNumber 16387 to IPV4://166.177.121.0:12273
relaying data fromIPV4://97.121.170.121:60183 over channelNumber 16387 to IPV4://166.177.121.0:12273
relaying data fromIPV4://97.121.170.121:60183 over channelNumber 16387 to IPV4://166.177.121.0:12273
relaying data fromIPV4://97.121.170.121:60183 over channelNumber 16387 to IPV4://166.177.121.0:12273
Receiving UDP: from IPV4://166.177.121.0:12273 to IPV4://shrek.best:3478 refresh request TransactionID: 2b7569575a2b355632304b57
lifetime: 0
username: user
realm: shrek.best
nonce: 16f6398d044aba5381cedde7309fdb4c
message-integrity: ee8f931a1dc5899d1e5c414e5ce2502e0cf93fb1
Sending UDP: from IPV4://shrek.best:3478 to IPV4://166.177.121.0:12273 refresh success TransactionID: 2b7569575a2b355632304b57
lifetime: 0
software: node-turn
message-integrity: d12e0880dcd3dfe7ca37541f20cd02076b20f1e9
relaying data fromIPV4://97.121.170.121:60183 over channelNumber 16387 to IPV4://166.177.121.0:12273
relaying data fromIPV4://97.121.170.121:60183 over channelNumber 16387 to IPV4://166.177.121.0:12273
relaying data fromIPV4://97.121.170.121:60183 over channelNumber 16387 to IPV4://166.177.121.0:12273
relaying data fromIPV4://97.121.170.121:60183 over channelNumber 16387 to IPV4://166.177.121.0:12273
这就是我的配置
var turn = new Turn({
// set options
listeningIps : ['shrek.best'],
authMech: 'long-term',
credentials: {
user: 'pass',
},
defaultAllocatetLifetime : 600000,
maxAllocateLifetime : 600000,
debugLevel : 'ALL',
realm : 'shrek.best',
});
关于如何解决这个问题的任何见解?
使用秒表后,我发现它在 40 秒后一直断开连接。