diff --git a/backend/package.json b/backend/package.json index bd84d54d9..2b6851fbd 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.331", + "version": "2.14.332", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/index.js b/backend/src/core/proxy-utils/index.js index 792d42279..099fcfcf7 100644 --- a/backend/src/core/proxy-utils/index.js +++ b/backend/src/core/proxy-utils/index.js @@ -438,6 +438,24 @@ function lastParse(proxy) { } } } + if (['ws', 'http', 'h2'].includes(proxy.network)) { + if ( + ['ws', 'h2'].includes(proxy.network) && + !proxy[`${proxy.network}-opts`]?.path + ) { + proxy[`${proxy.network}-opts`] = + proxy[`${proxy.network}-opts`] || {}; + proxy[`${proxy.network}-opts`].path = '/'; + } else if ( + proxy.network === 'http' && + (!Array.isArray(proxy[`${proxy.network}-opts`]?.path) || + proxy[`${proxy.network}-opts`]?.path.every((i) => !i)) + ) { + proxy[`${proxy.network}-opts`] = + proxy[`${proxy.network}-opts`] || {}; + proxy[`${proxy.network}-opts`].path = ['/']; + } + } if (['', 'off'].includes(proxy.sni)) { proxy['disable-sni'] = true; }