Skip to content

Commit

Permalink
fix: Surge Hysteria2 输出重复添加 tfo 的 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Oct 17, 2023
1 parent fa65eb1 commit c21ce0b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
14 changes: 10 additions & 4 deletions backend/src/core/proxy-utils/producers/surge.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit c21ce0b

Please sign in to comment.