From ed54d1ed38adafa280b019369a69a75f572fc5f5 Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Mon, 17 Jul 2023 08:54:53 +0700 Subject: [PATCH] Fix IPv6 feature not working --- better-xcloud.user.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/better-xcloud.user.js b/better-xcloud.user.js index cedf2c8..7940b79 100644 --- a/better-xcloud.user.js +++ b/better-xcloud.user.js @@ -356,10 +356,9 @@ function updateIceCandidates(candidates) { const newCandidates = []; let order = 1; - let priority = 100; lst.forEach(item => { item.order = order; - item.priority = priority; + item.priority = (order == 1) ? 100 : 1; newCandidates.push({ 'candidate': `a=candidate:${item.order} 1 UDP ${item.priority} ${item.ip} ${item.the_rest}`, @@ -369,7 +368,6 @@ function updateIceCandidates(candidates) { }); ++order; - --priority; }); newCandidates.push({ @@ -484,6 +482,7 @@ function interceptHttpRequests() { obj.exchangeResponse = JSON.stringify(exchangeResponse); response.json = () => Promise.resolve(obj); + response.text = () => Promise.resolve(JSON.stringify(obj)); return response; }); });