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');