From e40b9a77c4d94fe5bf670eaa61077658ee0a7d34 Mon Sep 17 00:00:00 2001 From: xream Date: Wed, 7 Feb 2024 15:14:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20Loon=20UDP=20?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- .../src/core/proxy-utils/producers/loon.js | 26 +++++++++++++------ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/backend/package.json b/backend/package.json index 2c9523f7f..d98728be6 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.212", + "version": "2.14.213", "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/loon.js b/backend/src/core/proxy-utils/producers/loon.js index d2521d9fd..005f17be2 100644 --- a/backend/src/core/proxy-utils/producers/loon.js +++ b/backend/src/core/proxy-utils/producers/loon.js @@ -83,7 +83,9 @@ function shadowsocks(proxy) { result.appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo'); // udp - result.appendIfPresent(`,udp=${proxy.udp}`, 'udp'); + if (proxy.udp) { + result.append(`,udp=true`); + } return result.toString(); } @@ -109,7 +111,9 @@ function shadowsocksr(proxy) { result.appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo'); // udp - result.appendIfPresent(`,udp=${proxy.udp}`, 'udp'); + if (proxy.udp) { + result.append(`,udp=true`); + } return result.toString(); } @@ -152,7 +156,9 @@ function trojan(proxy) { result.appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo'); // udp - result.appendIfPresent(`,udp=${proxy.udp}`, 'udp'); + if (proxy.udp) { + result.append(`,udp=true`); + } return result.toString(); } @@ -219,7 +225,9 @@ function vmess(proxy) { result.appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo'); // udp - result.appendIfPresent(`,udp=${proxy.udp}`, 'udp'); + if (proxy.udp) { + result.append(`,udp=true`); + } return result.toString(); } @@ -281,7 +289,9 @@ function vless(proxy) { result.appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo'); // udp - result.appendIfPresent(`,udp=${proxy.udp}`, 'udp'); + if (proxy.udp) { + result.append(`,udp=true`); + } return result.toString(); } @@ -304,8 +314,6 @@ function http(proxy) { // tfo result.appendIfPresent(`,tfo=${proxy.tfo}`, 'tfo'); - // udp - result.appendIfPresent(`,udp-relay=${proxy.udp}`, 'udp'); return result.toString(); } @@ -390,7 +398,9 @@ function hysteria2(proxy) { result.appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo'); // udp - result.appendIfPresent(`,udp=${proxy.udp}`, 'udp'); + if (proxy.udp) { + result.append(`,udp=true`); + } // download-bandwidth result.appendIfPresent(