我正在使用ProjectRTC,我用火狐和安卓客户端成功地测试了它。我把服务器代码放在一个远程服务器(Digitalocean)上,通过我的家用pc访问。
然而,在我使用家用ADSL或(较慢的)装有Firefox的pc上的ADSL和Android客户端上的3G/4G网络进行测试之前,一切都运行得很好。
如果我通过我的手机使用3G/4G网络(使用hotspot选项),它试图连接到客户端,但我在javascript控制台上收到错误消息"Ice Failed“。
我试图添加一个打开的客户端
public/javascripts/rtcClient.js添加以下内容:
var localId,
config = {
peerConnectionConfig: {
iceServers: [
/*test*/
{
"username":"e7db750a-2fcc-40c6-8415-cab22743a68a",
"url": "turn:turn1.xirsys.com:443?transport=tcp",
"credential":"287ae254-9380-4f81-af88-e1cc9ed27eb0"
},
{
"username":"e7db750a-2fcc-40c6-8415-cab22743a68a",
"url": "turn:turn1.xirsys.com:443?transport=udp",
"credential":"287ae254-9380-4f81-af88-e1cc9ed27eb0"
},
/*end test*/
{
"url": "stun:stun.l.google.com:19305"
}
]
},
peerConnectionConstraints: {
optional: [{
"DtlsSrtpKeyAgreement": true,
}]
}
},
peerDatabase = {},
localStream,
remoteVideoContainer = document.getElementById('remoteVideosContainer'),
socket = io();
socket.on('message', handleMessage);
socket.on('id', function(id) {
localId = id;
});但我还是没走运,又收到了"ICE失败“。
我也试着阅读this,但我不认为它是我要搜索的内容。你有什么想法让它在移动连接上工作吗?
提前感谢您的关注!
发布于 2016-05-05 05:56:53
不要硬编码你的ICE字符串。XirSys ICE字符串对时间敏感,将在30秒后过期。您需要为每个连接请求一个新的ICE字符串。这可能会解决您的问题,也可能不会,但它至少会排除ICE字符串是问题所在。
李,您好!
https://stackoverflow.com/questions/37032549
复制相似问题