mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 07:09:00 +08:00
feat: 组合订阅支持设置代理/策略, 链接支持传入 proxy
参数指定代理/策略
This commit is contained in:
parent
6d43961e96
commit
8ffb060cb4
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sub-store",
|
||||
"version": "2.14.389",
|
||||
"version": "2.14.390",
|
||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
@ -69,6 +69,7 @@ async function downloadSubscription(req, res) {
|
||||
produceType,
|
||||
includeUnsupportedProxy,
|
||||
resultFormat,
|
||||
proxy,
|
||||
} = req.query;
|
||||
let $options = {};
|
||||
if (req.query.$options) {
|
||||
@ -92,6 +93,10 @@ async function downloadSubscription(req, res) {
|
||||
url = decodeURIComponent(url);
|
||||
$.info(`指定远程订阅 URL: ${url}`);
|
||||
}
|
||||
if (proxy) {
|
||||
proxy = decodeURIComponent(proxy);
|
||||
$.info(`指定远程订阅使用代理/策略 proxy: ${proxy}`);
|
||||
}
|
||||
if (ua) {
|
||||
ua = decodeURIComponent(ua);
|
||||
$.info(`指定远程订阅 User-Agent: ${ua}`);
|
||||
@ -135,6 +140,7 @@ async function downloadSubscription(req, res) {
|
||||
'include-unsupported-proxy': includeUnsupportedProxy,
|
||||
},
|
||||
$options,
|
||||
proxy,
|
||||
});
|
||||
|
||||
if (
|
||||
@ -264,6 +270,7 @@ async function downloadCollection(req, res) {
|
||||
produceType,
|
||||
includeUnsupportedProxy,
|
||||
resultFormat,
|
||||
proxy,
|
||||
} = req.query;
|
||||
|
||||
let $options = {};
|
||||
@ -285,6 +292,11 @@ async function downloadCollection(req, res) {
|
||||
$.info(`传入 $options: ${JSON.stringify($options)}`);
|
||||
}
|
||||
|
||||
if (proxy) {
|
||||
proxy = decodeURIComponent(proxy);
|
||||
$.info(`指定远程订阅使用代理/策略 proxy: ${proxy}`);
|
||||
}
|
||||
|
||||
if (ignoreFailedRemoteSub != null && ignoreFailedRemoteSub !== '') {
|
||||
ignoreFailedRemoteSub = decodeURIComponent(ignoreFailedRemoteSub);
|
||||
$.info(`指定忽略失败的远程订阅: ${ignoreFailedRemoteSub}`);
|
||||
@ -311,6 +323,7 @@ async function downloadCollection(req, res) {
|
||||
'include-unsupported-proxy': includeUnsupportedProxy,
|
||||
},
|
||||
$options,
|
||||
proxy,
|
||||
});
|
||||
|
||||
// forward flow header from the first subscription in this collection
|
||||
@ -355,7 +368,7 @@ async function downloadCollection(req, res) {
|
||||
url,
|
||||
$arguments.flowUserAgent,
|
||||
undefined,
|
||||
sub.proxy,
|
||||
sub.proxy || collection.proxy || proxy,
|
||||
$arguments.flowUrl,
|
||||
);
|
||||
if (flowInfo) {
|
||||
|
@ -38,6 +38,7 @@ async function produceArtifact({
|
||||
subscription,
|
||||
awaitCustomCache,
|
||||
$options,
|
||||
proxy,
|
||||
}) {
|
||||
platform = platform || 'JSON';
|
||||
|
||||
@ -68,7 +69,7 @@ async function produceArtifact({
|
||||
url,
|
||||
ua || sub.ua,
|
||||
undefined,
|
||||
sub.proxy,
|
||||
sub.proxy || proxy,
|
||||
undefined,
|
||||
awaitCustomCache,
|
||||
);
|
||||
@ -115,7 +116,7 @@ async function produceArtifact({
|
||||
url,
|
||||
ua || sub.ua,
|
||||
undefined,
|
||||
sub.proxy,
|
||||
sub.proxy || proxy,
|
||||
undefined,
|
||||
awaitCustomCache,
|
||||
);
|
||||
@ -220,7 +221,9 @@ async function produceArtifact({
|
||||
url,
|
||||
sub.ua,
|
||||
undefined,
|
||||
sub.proxy,
|
||||
sub.proxy ||
|
||||
collection.proxy ||
|
||||
proxy,
|
||||
);
|
||||
} catch (err) {
|
||||
errors[url] = err;
|
||||
@ -344,7 +347,6 @@ async function produceArtifact({
|
||||
}
|
||||
exist[proxy.name] = true;
|
||||
}
|
||||
console.log(proxies);
|
||||
return ProxyUtils.produce(proxies, platform, produceType, produceOpts);
|
||||
} else if (type === 'rule') {
|
||||
const allRules = $.read(RULES_KEY);
|
||||
|
Loading…
x
Reference in New Issue
Block a user