Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Chain Proxy feature #76

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ jobs:
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
command: deploy
command: deploy
23 changes: 22 additions & 1 deletion src/ClashConfigBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ export class ClashConfigBuilder extends BaseConfigBuilder {
}

const proxyList = this.config.proxies.map(proxy => proxy.name);

const chainProxies = this.config.proxies.map(proxy => ({
...proxy,
name: proxy.name + '-chain',
'dialer-proxy': '🔗 中转站'
}));

this.config.proxies.unshift(...chainProxies);
const chainProxyList = chainProxies.map(proxy => proxy.name);

this.config['proxy-groups'].push({
name: '⚡ 自动选择',
Expand All @@ -57,7 +66,7 @@ export class ClashConfigBuilder extends BaseConfigBuilder {
this.config['proxy-groups'].unshift({
type: "select",
name: outbound,
proxies: proxyList
proxies: [...proxyList, '🔓 链式落地']
});
}
});
Expand All @@ -77,6 +86,18 @@ export class ClashConfigBuilder extends BaseConfigBuilder {
name: "🐟 漏网之鱼",
proxies: ['🚀 节点选择', ...proxyList]
});

this.config['proxy-groups'].push({
type: "select",
name: "🔓 链式落地",
proxies: [...chainProxyList]
});

this.config['proxy-groups'].push({
type: "select",
name: "🔗 中转站",
proxies: [...proxyList]
});
}
formatConfig() {
const rules = generateRules(this.selectedRules, this.customRules, this.pin);
Expand Down
2 changes: 1 addition & 1 deletion src/SingboxConfigBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class ConfigBuilder extends BaseConfigBuilder {
}

const proxyList = this.config.outbounds.filter(outbound => outbound?.server != undefined).map(outbound => outbound.tag);

this.config.outbounds.unshift({
type: "urltest",
tag: "⚡ 自动选择",
Expand Down