Я пытаюсь найти IP -адрес клиента, используя WEBRTC, но в Firefox я получу эту ошибку: < /p>
ICE не удалось, ваш сервер поворота, кажется, сломан, см. О: webrtc для получения более подробной информации < /strong> < /p>
см. var myPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
var pc = new myPeerConnection({ iceServers: [
{ url: "turn:numb.viagenie.ca:3478", username: "[email protected]", "credential": "xxxxxx" },
{ urls: "stun:stun.l.google.com:19302" }
] }),
noop = function () { },
localIPs = {},
ipRegex = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/g,
key;
function ipIterate(ip) {
if (!localIPs[ip]) onNewIP(ip);
localIPs[ip] = true;
}
pc.createDataChannel("");
pc.createOffer(function (sdp) {
sdp.sdp.split('\n').forEach(function (line) {
if (line.indexOf('candidate') < 0) return;
line.match(ipRegex).forEach(ipIterate);
});
pc.setLocalDescription(sdp, noop, noop);
}, noop);
pc.onicecandidate = function (ice) {
if (!ice || !ice.candidate || !ice.candidate.candidate || !ice.candidate.candidate.match(ipRegex)) return;
ice.candidate.candidate.match(ipRegex).forEach(ipIterate);
};
< /code>
Войдите в систему о: webrtc: < /p>
< /p>
й relay grog " /> < /p>
0.009 RTP Host 3350409123 UDP E6E7F092-E632-4986-97B2-90B20C3B15CD.LOCAL 59923 126 | 30 | 255
0.062 RTP SRFLX 842163049 UDP IP 59923 100 | 30 | 255
0.313 RTP RELAY 453802058 UDP IP 57652 2 | 30 | 255
0.313 выполнен
0.315
Подробнее здесь: https://stackoverflow.com/questions/602 ... r-more-det
ICE вышел из строя, ваш сервер поворота, кажется, сломан, см. В WEBRTC для более подробной информации ⇐ Html
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Сервер Jupyter вышел из строя. Не удалось подключиться. Код ошибки от Jupyter: 1"
Anonymous » » в форуме Python - 0 Ответы
- 15 Просмотры
-
Последнее сообщение Anonymous
-