diff --git a/backend/package.json b/backend/package.json index c7db840a..388afd5a 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.20.79", + "version": "2.20.80", "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/clash.js b/backend/src/core/proxy-utils/producers/clash.js index 0fba9769..2975710a 100644 --- a/backend/src/core/proxy-utils/producers/clash.js +++ b/backend/src/core/proxy-utils/producers/clash.js @@ -47,6 +47,11 @@ export default function Clash_Producer() { proxy['reality-opts'])) ) { return false; + } else if ( + ['ws'].includes(proxy.network) && + proxy['ws-opts']?.['v2ray-http-upgrade'] + ) { + return false; } else if (proxy['underlying-proxy'] || proxy['dialer-proxy']) { $.error( `Clash 不支持前置代理字段. 已过滤节点 ${proxy.name}`, diff --git a/backend/src/core/proxy-utils/producers/egern.js b/backend/src/core/proxy-utils/producers/egern.js index 6c225f4f..8dea77e6 100644 --- a/backend/src/core/proxy-utils/producers/egern.js +++ b/backend/src/core/proxy-utils/producers/egern.js @@ -67,6 +67,11 @@ export default function Egern_Producer() { proxy.token.length !== 0) ) { return false; + } else if ( + ['ws'].includes(proxy.network) && + proxy['ws-opts']?.['v2ray-http-upgrade'] + ) { + return false; } return true; }) diff --git a/backend/src/core/proxy-utils/producers/loon.js b/backend/src/core/proxy-utils/producers/loon.js index 6f600449..d45bd01d 100644 --- a/backend/src/core/proxy-utils/producers/loon.js +++ b/backend/src/core/proxy-utils/producers/loon.js @@ -13,6 +13,14 @@ const ipVersions = { export default function Loon_Producer() { const produce = (proxy, type, opts = {}) => { + if ( + ['ws'].includes(proxy.network) && + proxy['ws-opts']?.['v2ray-http-upgrade'] + ) { + throw new Error( + `Platform ${targetPlatform} does not support network ${proxy.network} with http upgrade`, + ); + } switch (proxy.type) { case 'ss': return shadowsocks(proxy); @@ -398,7 +406,8 @@ function vmess(proxy) { } function vless(proxy) { - if (proxy.encryption && proxy.encryption !== 'none') throw new Error(`VLESS encryption is not supported`); + if (proxy.encryption && proxy.encryption !== 'none') + throw new Error(`VLESS encryption is not supported`); let isXtls = false; const isReality = !!proxy['reality-opts']; diff --git a/backend/src/core/proxy-utils/producers/qx.js b/backend/src/core/proxy-utils/producers/qx.js index d1b4c0dc..c5ab8cec 100644 --- a/backend/src/core/proxy-utils/producers/qx.js +++ b/backend/src/core/proxy-utils/producers/qx.js @@ -5,6 +5,14 @@ const targetPlatform = 'QX'; export default function QX_Producer() { // eslint-disable-next-line no-unused-vars const produce = (proxy, type, opts = {}) => { + if ( + ['ws'].includes(proxy.network) && + proxy['ws-opts']?.['v2ray-http-upgrade'] + ) { + throw new Error( + `Platform ${targetPlatform} does not support network ${proxy.network} with http upgrade`, + ); + } switch (proxy.type) { case 'ss': return shadowsocks(proxy); diff --git a/backend/src/core/proxy-utils/producers/stash.js b/backend/src/core/proxy-utils/producers/stash.js index 4419e2d4..fd364e51 100644 --- a/backend/src/core/proxy-utils/producers/stash.js +++ b/backend/src/core/proxy-utils/producers/stash.js @@ -70,7 +70,16 @@ export default function Stash_Producer() { return false; } else if (['xhttp'].includes(proxy.network)) { return false; - } else if (proxy.encryption && proxy.encryption !== 'none' && ['vless'].includes(proxy.type)) { + } else if ( + proxy.encryption && + proxy.encryption !== 'none' && + ['vless'].includes(proxy.type) + ) { + return false; + } else if ( + ['ws'].includes(proxy.network) && + proxy['ws-opts']?.['v2ray-http-upgrade'] + ) { return false; } return true; diff --git a/backend/src/core/proxy-utils/producers/surfboard.js b/backend/src/core/proxy-utils/producers/surfboard.js index 01341e44..1328a3df 100644 --- a/backend/src/core/proxy-utils/producers/surfboard.js +++ b/backend/src/core/proxy-utils/producers/surfboard.js @@ -6,6 +6,14 @@ const targetPlatform = 'Surfboard'; export default function Surfboard_Producer() { const produce = (proxy) => { + if ( + ['ws'].includes(proxy.network) && + proxy['ws-opts']?.['v2ray-http-upgrade'] + ) { + throw new Error( + `Platform ${targetPlatform} does not support network ${proxy.network} with http upgrade`, + ); + } proxy.name = proxy.name.replace(/=|,/g, ''); switch (proxy.type) { case 'ss': diff --git a/backend/src/core/proxy-utils/producers/surge.js b/backend/src/core/proxy-utils/producers/surge.js index 3eac5702..7df20126 100644 --- a/backend/src/core/proxy-utils/producers/surge.js +++ b/backend/src/core/proxy-utils/producers/surge.js @@ -14,6 +14,14 @@ const ipVersions = { export default function Surge_Producer() { const produce = (proxy, type, opts = {}) => { + if ( + ['ws'].includes(proxy.network) && + proxy['ws-opts']?.['v2ray-http-upgrade'] + ) { + throw new Error( + `Platform ${targetPlatform} does not support network ${proxy.network} with http upgrade`, + ); + } proxy.name = proxy.name.replace(/=|,/g, ''); if (proxy.ports) { proxy.ports = String(proxy.ports);