feat: Stash 输出中过滤掉有前置代理的节点, 并在日志中提示

This commit is contained in:
xream 2025-04-22 09:42:32 +08:00
parent 95f181351a
commit 4c4bda563a
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 7 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "sub-store", "name": "sub-store",
"version": "2.19.31", "version": "2.19.32",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
"main": "src/main.js", "main": "src/main.js",
"scripts": { "scripts": {

View File

@ -1,4 +1,5 @@
import { isPresent } from '@/core/proxy-utils/producers/utils'; import { isPresent } from '@/core/proxy-utils/producers/utils';
import $ from '@/core/app';
export default function Stash_Producer() { export default function Stash_Producer() {
const type = 'ALL'; const type = 'ALL';
@ -50,6 +51,11 @@ export default function Stash_Producer() {
: proxy.type === 'vless' && proxy['reality-opts']) : proxy.type === 'vless' && proxy['reality-opts'])
) { ) {
return false; return false;
} else if (proxy['underlying-proxy'] || proxy['dialer-proxy']) {
$.error(
`Stash 暂不支持前置代理字段. 已过滤节点 ${proxy.name}. 请使用 代理的转发链 https://stash.wiki/proxy-protocols/proxy-groups#relay`,
);
return false;
} }
return true; return true;
}) })
@ -257,11 +263,6 @@ export default function Stash_Producer() {
} }
delete proxy['tls-fingerprint']; delete proxy['tls-fingerprint'];
if (proxy['underlying-proxy']) {
proxy['dialer-proxy'] = proxy['underlying-proxy'];
}
delete proxy['underlying-proxy'];
if (isPresent(proxy, 'tls') && typeof proxy.tls !== 'boolean') { if (isPresent(proxy, 'tls') && typeof proxy.tls !== 'boolean') {
delete proxy.tls; delete proxy.tls;
} }