From c21ce0be16566f4a9c43c2d322df41541ea1ba2b Mon Sep 17 00:00:00 2001 From: xream Date: Wed, 18 Oct 2023 05:09:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Surge=20Hysteria2=20=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E6=B7=BB=E5=8A=A0=20tfo=20=E7=9A=84=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/core/proxy-utils/producers/surge.js | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/backend/package.json b/backend/package.json index c9ec004ea..41f8744ac 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.73", + "version": "2.14.74", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/producers/surge.js b/backend/src/core/proxy-utils/producers/surge.js index 127a27e2e..918255dad 100644 --- a/backend/src/core/proxy-utils/producers/surge.js +++ b/backend/src/core/proxy-utils/producers/surge.js @@ -320,8 +320,11 @@ function tuic(proxy) { ); // tfo - result.appendIfPresent(`,tfo=${proxy['fast-open']}`, 'fast-open'); - result.appendIfPresent(`,tfo=${proxy.tfo}`, 'tfo'); + if (isPresent(proxy, 'tfo')) { + result.append(`,tfo=${proxy['tfo']}`); + } else if (isPresent(proxy, 'fast-open')) { + result.append(`,tfo=${proxy['fast-open']}`); + } // test-url result.appendIfPresent(`,test-url=${proxy['test-url']}`, 'test-url'); @@ -399,8 +402,11 @@ function hysteria2(proxy) { ); // tfo - result.appendIfPresent(`,tfo=${proxy['fast-open']}`, 'fast-open'); - result.appendIfPresent(`,tfo=${proxy.tfo}`, 'tfo'); + if (isPresent(proxy, 'tfo')) { + result.append(`,tfo=${proxy['tfo']}`); + } else if (isPresent(proxy, 'fast-open')) { + result.append(`,tfo=${proxy['fast-open']}`); + } // test-url result.appendIfPresent(`,test-url=${proxy['test-url']}`, 'test-url');