Fix IPv6 feature not working

This commit is contained in:
redphx 2023-07-17 08:54:53 +07:00
parent 4676e42215
commit ed54d1ed38

View File

@ -356,10 +356,9 @@ function updateIceCandidates(candidates) {
const newCandidates = []; const newCandidates = [];
let order = 1; let order = 1;
let priority = 100;
lst.forEach(item => { lst.forEach(item => {
item.order = order; item.order = order;
item.priority = priority; item.priority = (order == 1) ? 100 : 1;
newCandidates.push({ newCandidates.push({
'candidate': `a=candidate:${item.order} 1 UDP ${item.priority} ${item.ip} ${item.the_rest}`, 'candidate': `a=candidate:${item.order} 1 UDP ${item.priority} ${item.ip} ${item.the_rest}`,
@ -369,7 +368,6 @@ function updateIceCandidates(candidates) {
}); });
++order; ++order;
--priority;
}); });
newCandidates.push({ newCandidates.push({
@ -484,6 +482,7 @@ function interceptHttpRequests() {
obj.exchangeResponse = JSON.stringify(exchangeResponse); obj.exchangeResponse = JSON.stringify(exchangeResponse);
response.json = () => Promise.resolve(obj); response.json = () => Promise.resolve(obj);
response.text = () => Promise.resolve(JSON.stringify(obj));
return response; return response;
}); });
}); });