Skip to content

Instantly share code, notes, and snippets.

@CodeBoy2006
Created July 29, 2025 08:45
Show Gist options
  • Select an option

  • Save CodeBoy2006/ac69db3835750faff0caa015a022dbc5 to your computer and use it in GitHub Desktop.

Select an option

Save CodeBoy2006/ac69db3835750faff0caa015a022dbc5 to your computer and use it in GitHub Desktop.
Mihomo Party Override
/**
* ไธชไบบๅค‡ไปฝไฝฟ็”จ๏ผŒ่ฏฅ่„šๆœฌ้€‚็”จไธŽMihomo Partyๅ’Œ Clash Verge Rev
* Clash Verge Rev ๅ…จๅฑ€ๆ‰ฉๅฑ•่„šๆœฌ๏ผˆๆ‡’ไบบ้…็ฝฎ๏ผ‰/ Mihomo Party ่ฆ†ๅ†™่„šๆœฌ
*
* V6: Applied modern DNS and performance optimizations.
* - Replaced old DNS structure with a robust nameserver/fallback model to prevent leaks.
* - Enabled DNS over QUIC (prefer-h3) for faster lookups.
* - Removed default-nameserver to eliminate startup leaks.
* - Added experimental tcp-concurrent for latency reduction.
* V5: Added proxy node preprocessing to rename nodes conflicting with group names.
* V4: Expanded EU country list in euKeywords. Filter logic remains V3 (negative lookarounds).
*/
// --- Helper Function for Creating Filter Regex ---
/**
* Creates a case-insensitive regex string for filtering proxy names.
* Ensures keywords containing English letters are not directly adjacent to other English letters.
* Allows other characters (spaces, numbers, symbols, CJK, etc.) to be adjacent.
* @param {string[]} items - Array of keywords (e.g., ['HK', 'Hong Kong', '้ฆ™ๆธฏ', '๐Ÿ‡ญ๐Ÿ‡ฐ'])
* @returns {string} - A regex string like '(?i)((?<![a-zA-Z])HK(?![a-zA-Z])|(?<![a-zA-Z])Hong Kong(?![a-zA-Z])|้ฆ™ๆธฏ|๐Ÿ‡ญ๐Ÿ‡ฐ)'
*/
function createFilterRegex(items) {
const regexItems = items.map(item => {
// Escape potential regex special characters within the item
const escapedItem = item.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
// Apply lookarounds ONLY if the item contains English letters
if (/[a-zA-Z]/.test(escapedItem)) {
// Assert not preceded by an English letter AND not followed by an English letter
return `(?<![a-zA-Z])${escapedItem}(?![a-zA-Z])`;
} else {
// For flags, pure CJK, etc., match literally
return escapedItem;
}
});
// Combine with OR '|' and add case-insensitive flag (?i)
return `(?i)(${regexItems.join('|')})`;
}
// --- End Helper Function ---
// ๅคš่ฎข้˜…ๅˆๅนถ๏ผŒ่ฟ™้‡ŒๆทปๅŠ ้ขๅค–็š„ๅœฐๅ€
const proxyProviders = {
};
// ็จ‹ๅบๅ…ฅๅฃ
function main(config) {
const initialProxies = config?.proxies ?? [];
const proxyCount = initialProxies.length;
const originalProviders = config?.["proxy-providers"] || {};
const proxyProviderCount = typeof originalProviders === "object" ? Object.keys(originalProviders).length : 0;
const addedProviderCount = typeof proxyProviders === "object" ? Object.keys(proxyProviders).length : 0;
// Check if there are any proxies or providers defined at all
if (proxyCount === 0 && proxyProviderCount === 0 && addedProviderCount === 0) {
// Throw error only if *absolutely nothing* is defined (no initial proxies, no original providers, no added providers)
// If providers exist (original or added), we assume proxies *will* be loaded later.
throw new Error("้…็ฝฎๆ–‡ไปถๅ’Œ่„šๆœฌไธญๅ‡ๆœชๆ‰พๅˆฐไปปไฝ•ไปฃ็†ๆˆ–ไปฃ็†่ฎข้˜…");
}
// Generate proxy groups first to get their names
const generatedProxyGroups = generateProxyGroups(); // Use function to generate groups
const groupNames = new Set(generatedProxyGroups.map(group => group.name));
// --- Preprocess existing proxies to avoid name conflicts ---
let renamedCount = 0;
if (Array.isArray(initialProxies) && initialProxies.length > 0) {
config.proxies = initialProxies.map(proxy => {
if (proxy && typeof proxy.name === 'string' && groupNames.has(proxy.name)) {
const oldName = proxy.name;
const newName = `${oldName}_node`; // Append suffix
// Optional: Log the renaming action if running in an environment that supports console.log
// console.log(`Renaming conflicting proxy node: "${oldName}" -> "${newName}"`);
renamedCount++;
return { ...proxy, name: newName }; // Return a new object with the modified name
}
return proxy; // Return unchanged proxy
});
// Optional: Log summary if needed
// if (renamedCount > 0) {
// console.log(`Renamed ${renamedCount} proxy node(s) that conflicted with group names.`);
// }
}
// --- End Preprocessing ---
// Assign configurations
config["proxy-providers"] = { ...originalProviders, ...proxyProviders };
config["dns"] = dnsConfig; // Assign the new, optimized DNS config
config["proxy-groups"] = generatedProxyGroups;
config["rule-providers"] = ruleProviders;
config["rules"] = rules;
config["mixed-port"] = 7890;
config["allow-lan"] = true;
config["bind-address"] = "*";
config["ipv6"] = true;
config["unified-delay"] = true;
// --- ADDED: Experimental Features for Performance ---
// Enables concurrent TCP/UDP requests to reduce latency, especially on high-latency links.
// For best results, TCP Fast Open support should be enabled in the OS kernel (Linux/macOS).
config["experimental"] = {
"tcp-concurrent": true,
"udp-concurrent": true, // Enable for UDP as well if needed
};
// Add tun configuration if needed for TUN mode
// config["tun"] = {
// "enable": true,
// "stack": "system", // or "gvisor" or "mixed"
// "device": "utun", // Or other name like tun0 / clash
// "dns-hijack": ["any:53"]
// };
return config;
}
// ===================================================================================
// --- OPTIMIZED DNS CONFIGURATION ---
// 1. fallback: If 'nameserver' (primary) returns a poisoned IP, 'fallback' is used.
// 2. fallback-filter: Automatically uses 'fallback' for non-Chinese domains, preventing leaks and speeding up foreign lookups.
// 3. prefer-h3: Enables DNS over QUIC/HTTP3 for faster lookups.
// 4. Removed default-nameserver: Prevents potential DNS leaks on startup.
// 5. IP#Host format: Bypasses simple domain-based DNS blocking.
// ===================================================================================
// Primary DNS for domestic domains (fast and in China)
const domesticNameservers = [
"https://223.5.5.5/dns-query", // AliDNS DoH
"https://doh.pub/dns-query", // Tencent DoH
];
// Fallback DNS for foreign domains (via proxy, privacy-focused)
const foreignNameservers = [
"https://1.1.1.1/dns-query#host=cloudflare-dns.com", // Cloudflare DNS (IP format for robustness)
"https://dns.google/dns-query", // Google DNS
"https://9.9.9.9/dns-query", // Quad9 DNS
];
// The optimized DNS configuration object
const dnsConfig = {
"enable": true,
"listen": "0.0.0.0:1053",
"ipv6": true, // Keep enabled, but can be disabled if local IPv6 is poor
"prefer-h3": true, // Enable DNS over QUIC for speed
"respect-rules": true, // IMPORTANT: Must be true for nameserver-policy to work
"use-system-hosts": false,
"cache-algorithm": "arc",
"enhanced-mode": "fake-ip",
"fake-ip-range": "198.18.0.1/16",
"fake-ip-filter": [
// ๆœฌๅœฐไธปๆœบ/่ฎพๅค‡
"+.lan",
"+.local",
// Windows็ฝ‘็ปœๅ‡บ็Žฐๅฐๅœฐ็ƒๅ›พๆ ‡
"+.msftconnecttest.com",
"+.msftncsi.com",
// QQๅฟซ้€Ÿ็™ปๅฝ•ๆฃ€ๆต‹ๅคฑ่ดฅ
"localhost.ptlogin2.qq.com",
"localhost.sec.qq.com",
// ๅพฎไฟกๅฟซ้€Ÿ็™ปๅฝ•ๆฃ€ๆต‹ๅคฑ่ดฅ
"localhost.work.weixin.qq.com"
],
// Primary DNS servers (used for domains matching nameserver-policy)
"nameserver": domesticNameservers,
// Fallback DNS servers (used for everything else, queries go through proxy)
"fallback": foreignNameservers,
// This is the core of smart DNS routing
"fallback-filter": {
"geoip": true,
"geoip-code": "CN",
"geosite": ["geolocation-!cn"] // If a domain is not in geosite:cn, use fallback directly
},
// Route specific domains to specific nameservers before fallback logic
"nameserver-policy": {
"geosite:cn": domesticNameservers,
"geosite:apple-cn": domesticNameservers // Crucial for Apple services in China
}
// The old keys like 'default-nameserver', 'proxy-server-nameserver', 'direct-nameserver'
// are no longer needed with this modern, robust configuration.
};
// ไปฃ็†็ป„้€š็”จ้…็ฝฎ
const groupBaseOption = {
"interval": 300, "timeout": 3000, "url": "https://www.gstatic.com/generate_204",
"max-failed-times": 3, "hidden": false
};
// ้€š็”จๆŽ’้™ค่ฟ‡ๆปคๅ™จ
const regionalExcludeFilter = "(?i)GB|Traffic|Expire|Premium|้ข‘้“|่ฎข้˜…|ๆต้‡|ๅˆฐๆœŸ|้‡็ฝฎ|ไธญๅ›ฝ|CN|๐Ÿ‡จ๐Ÿ‡ณ|China|ๅ›žๅ›ฝ";
// --- Updated EU ๅ›ฝๅฎถๅ…ณ้”ฎๅญ— ---
const euKeywords = [
// Original set
'DE', 'FR', 'NL', 'GB', 'UK', 'IE', 'SE', 'CH', 'BE', 'ES', 'IT', 'AT', 'FI', 'DK', 'PL',
'ๅพทๅ›ฝ', 'ๆณ•ๅ›ฝ', '่ทๅ…ฐ', '่‹ฑๅ›ฝ', '็ˆฑๅฐ”ๅ…ฐ', '็‘žๅ…ธ', '็‘žๅฃซ', 'ๆฏ”ๅˆฉๆ—ถ', '่ฅฟ็ญ็‰™', 'ๆ„ๅคงๅˆฉ', 'ๅฅฅๅœฐๅˆฉ', '่Šฌๅ…ฐ', 'ไธน้บฆ', 'ๆณขๅ…ฐ',
'Germany', 'France', 'Netherlands', 'United Kingdom', 'Ireland', 'Sweden', 'Switzerland', 'Belgium', 'Spain', 'Italy', 'Austria', 'Finland', 'Denmark', 'Poland',
'๐Ÿ‡ฉ๐Ÿ‡ช', '๐Ÿ‡ซ๐Ÿ‡ท', '๐Ÿ‡ณ๐Ÿ‡ฑ', '๐Ÿ‡ฌ๐Ÿ‡ง', '๐Ÿ‡ฎ๐Ÿ‡ช', '๐Ÿ‡ธ๐Ÿ‡ช', '๐Ÿ‡จ๐Ÿ‡ญ', '๐Ÿ‡ง๐Ÿ‡ช', '๐Ÿ‡ช๐Ÿ‡ธ', '๐Ÿ‡ฎ๐Ÿ‡น', '๐Ÿ‡ฆ๐Ÿ‡น', '๐Ÿ‡ซ๐Ÿ‡ฎ', '๐Ÿ‡ฉ๐Ÿ‡ฐ', '๐Ÿ‡ต๐Ÿ‡ฑ',
// Added countries
'LU', 'PT', 'GR', 'CZ', 'HU', 'RO', 'BG', 'SK', 'HR', 'LT', 'LV', 'EE', 'SI', 'CY', 'MT',
'ๅขๆฃฎๅ ก', '่‘ก่„็‰™', 'ๅธŒ่…Š', 'ๆทๅ…‹', 'ๅŒˆ็‰™ๅˆฉ', '็ฝ—้ฉฌๅฐผไบš', 'ไฟๅŠ ๅˆฉไบš', 'ๆ–ฏๆด›ไผๅ…‹', 'ๅ…‹็ฝ—ๅœฐไบš', '็ซ‹้™ถๅฎ›', 'ๆ‹‰่„ฑ็ปดไบš', '็ˆฑๆฒ™ๅฐผไบš', 'ๆ–ฏๆด›ๆ–‡ๅฐผไบš', 'ๅกžๆตฆ่ทฏๆ–ฏ', '้ฉฌ่€ณไป–',
'Luxembourg', 'Portugal', 'Greece', 'Czech Republic', 'Hungary', 'Romania', 'Bulgaria', 'Slovakia', 'Croatia', 'Lithuania', 'Latvia', 'Estonia', 'Slovenia', 'Cyprus', 'Malta',
'๐Ÿ‡ฑ๐Ÿ‡บ', '๐Ÿ‡ต๐Ÿ‡น', '๐Ÿ‡ฌ๐Ÿ‡ท', '๐Ÿ‡จ๐Ÿ‡ฟ', '๐Ÿ‡ญ๐Ÿ‡บ', '๐Ÿ‡ท๐Ÿ‡ด', '๐Ÿ‡ง๐Ÿ‡ฌ', '๐Ÿ‡ธ๐Ÿ‡ฐ', '๐Ÿ‡ญ๐Ÿ‡ท', '๐Ÿ‡ฑ๐Ÿ‡น', '๐Ÿ‡ฑ๐Ÿ‡ป', '๐Ÿ‡ช๐Ÿ‡ช', '๐Ÿ‡ธ๐Ÿ‡ฎ', '๐Ÿ‡จ๐Ÿ‡พ', '๐Ÿ‡ฒ๐Ÿ‡น'
];
const euFilter = createFilterRegex(euKeywords);
// ๆ‰€ๆœ‰ๅŒบๅŸŸ็ป„ๅ็งฐๅˆ—่กจ
const regionalGroupNames = [
"๐Ÿ‡ญ๐Ÿ‡ฐ HK", "๐Ÿ‡น๐Ÿ‡ผ TW", "๐Ÿ‡ฏ๐Ÿ‡ต JP", "๐Ÿ‡ฐ๐Ÿ‡ท KR", "๐Ÿ‡บ๐Ÿ‡ธ US",
"๐Ÿ‡ธ๐Ÿ‡ฌ SG", "๐Ÿ‡จ๐Ÿ‡ฆ CA", "๐Ÿ‡ฆ๐Ÿ‡บ AU", "๐Ÿ‡ฌ๐Ÿ‡ง UK", "๐Ÿ‡ฉ๐Ÿ‡ช DE",
"๐Ÿ‡ซ๐Ÿ‡ท FR", "๐Ÿ‡ณ๐Ÿ‡ฑ NL", "๐Ÿ‡ช๐Ÿ‡บ EU",
"๐Ÿ‡ฒ๐Ÿ‡พ MY", "๐Ÿ‡ท๐Ÿ‡บ RU"
];
// Function to generate Proxy Group Configuration
function generateProxyGroups() {
return [
{
...groupBaseOption, "name": "๐ŸŒ Proxy", "type": "select",
"proxies": [ "โš™๏ธ Fixed-Proxy", "โš–๏ธ LoadBalance", "๐Ÿ”— Chain Relay (A->B)", "DIRECT", "REJECT" ],
"include-all": false, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Global.png"
},
{
"name": "โš™๏ธ Fixed-Proxy", "type": "select", "proxies": ["โšก AUTO", ...regionalGroupNames ],
"include-all": true, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Direct.png"
},
{
...groupBaseOption, "name": "โš–๏ธ LoadBalance", "type": "load-balance", "strategy": "consistent-hashing",
"proxies": regionalGroupNames, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Direct.png"
},
{
"name": "โ›“๏ธ Fixed-Proxy-A", "type": "select", "proxies": [ "DIRECT", ...regionalGroupNames ],
"include-all": true, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Direct.png"
},
{
"name": "โ›“๏ธ Fixed-Proxy-B", "type": "select", "proxies": [ ...regionalGroupNames ],
"include-all": true, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Direct.png"
},
{
...groupBaseOption, "name": "๐Ÿ”— Chain Relay (A->B)", "type": "relay",
"proxies": [ "โ›“๏ธ Fixed-Proxy-A", "โ›“๏ธ Fixed-Proxy-B" ], "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Direct.png"
},
{
...groupBaseOption, "name": "โšก AUTO", "type": "url-test", "include-all": true,
"tolerance": 50, "exclude-filter": regionalExcludeFilter, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Speedtest.png"
},
// --- Regional Groups using the createFilterRegex ---
{
...groupBaseOption, "name": "๐Ÿ‡ญ๐Ÿ‡ฐ HK", "type": "url-test", "include-all": true,
"filter": createFilterRegex(['้ฆ™ๆธฏ', 'Hong Kong', 'HK', '๐Ÿ‡ญ๐Ÿ‡ฐ']),
"exclude-filter": regionalExcludeFilter, "tolerance": 50, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Hong_Kong.png"
},
{
...groupBaseOption, "name": "๐Ÿ‡น๐Ÿ‡ผ TW", "type": "url-test", "include-all": true,
"filter": createFilterRegex(['ๅฐๆนพ', 'Taiwan', 'TW', '๐Ÿ‡น๐Ÿ‡ผ']),
"exclude-filter": regionalExcludeFilter, "tolerance": 50, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Taiwan.png"
},
{
...groupBaseOption, "name": "๐Ÿ‡ฏ๐Ÿ‡ต JP", "type": "url-test", "include-all": true,
"filter": createFilterRegex(['ๆ—ฅๆœฌ', 'Japan', 'JP', '๐Ÿ‡ฏ๐Ÿ‡ต']),
"exclude-filter": regionalExcludeFilter, "tolerance": 50, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Japan.png"
},
{
...groupBaseOption, "name": "๐Ÿ‡ฐ๐Ÿ‡ท KR", "type": "url-test", "include-all": true,
"filter": createFilterRegex(['้Ÿฉๅ›ฝ', 'Korea', 'KR', '๐Ÿ‡ฐ๐Ÿ‡ท']),
"exclude-filter": regionalExcludeFilter, "tolerance": 50, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Korea.png"
},
{
...groupBaseOption, "name": "๐Ÿ‡บ๐Ÿ‡ธ US", "type": "url-test", "include-all": true,
"filter": createFilterRegex(['็พŽๅ›ฝ', 'United States', 'US', '๐Ÿ‡บ๐Ÿ‡ธ']),
"exclude-filter": regionalExcludeFilter, "tolerance": 50, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/United_States.png"
},
{
...groupBaseOption, "name": "๐Ÿ‡ฉ๐Ÿ‡ช DE", "type": "url-test", "include-all": true,
"filter": createFilterRegex(['ๅพทๅ›ฝ', 'Germany', 'DE', '๐Ÿ‡ฉ๐Ÿ‡ช']),
"exclude-filter": regionalExcludeFilter, "tolerance": 50, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Germany.png"
},
{
...groupBaseOption, "name": "๐Ÿ‡ธ๐Ÿ‡ฌ SG", "type": "url-test", "include-all": true,
"filter": createFilterRegex(['ๆ–ฐๅŠ ๅก', 'Singapore', 'SG', '๐Ÿ‡ธ๐Ÿ‡ฌ']),
"exclude-filter": regionalExcludeFilter, "tolerance": 50, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Singapore.png"
},
{
...groupBaseOption, "name": "๐Ÿ‡ซ๐Ÿ‡ท FR", "type": "url-test", "include-all": true,
"filter": createFilterRegex(['ๆณ•ๅ›ฝ', 'France', 'FR', '๐Ÿ‡ซ๐Ÿ‡ท']),
"exclude-filter": regionalExcludeFilter, "tolerance": 50, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/France.png"
},
{
...groupBaseOption, "name": "๐Ÿ‡ฌ๐Ÿ‡ง UK", "type": "url-test", "include-all": true,
"filter": createFilterRegex(['่‹ฑๅ›ฝ', 'United Kingdom', 'UK', 'GB', '๐Ÿ‡ฌ๐Ÿ‡ง']),
"exclude-filter": regionalExcludeFilter, "tolerance": 50, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/United_Kingdom.png"
},
{
...groupBaseOption, "name": "๐Ÿ‡จ๐Ÿ‡ฆ CA", "type": "url-test", "include-all": true,
"filter": createFilterRegex(['ๅŠ ๆ‹ฟๅคง', 'Canada', 'CA', '๐Ÿ‡จ๐Ÿ‡ฆ']),
"exclude-filter": regionalExcludeFilter, "tolerance": 50, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Canada.png"
},
{
...groupBaseOption, "name": "๐Ÿ‡ฆ๐Ÿ‡บ AU", "type": "url-test", "include-all": true,
"filter": createFilterRegex(['ๆพณๅคงๅˆฉไบš', 'Australia', 'AU', '๐Ÿ‡ฆ๐Ÿ‡บ']),
"exclude-filter": regionalExcludeFilter, "tolerance": 50, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Australia.png"
},
{
...groupBaseOption, "name": "๐Ÿ‡ณ๐Ÿ‡ฑ NL", "type": "url-test", "include-all": true,
"filter": createFilterRegex(['่ทๅ…ฐ', 'Netherlands', 'NL', '๐Ÿ‡ณ๐Ÿ‡ฑ']),
"exclude-filter": regionalExcludeFilter, "tolerance": 50, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Netherlands.png"
},
{
...groupBaseOption, "name": "๐Ÿ‡ช๐Ÿ‡บ EU", "type": "url-test", "include-all": true,
"filter": euFilter,
"exclude-filter": regionalExcludeFilter, "tolerance": 50, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/European_Union.png"
},
{
...groupBaseOption, "name": "๐Ÿ‡ฒ๐Ÿ‡พ MY", "type": "url-test", "include-all": true,
"filter": createFilterRegex(['้ฉฌๆฅ่ฅฟไบš', 'Malaysia', 'MY', '๐Ÿ‡ฒ๐Ÿ‡พ']),
"exclude-filter": regionalExcludeFilter, "tolerance": 50, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Malaysia.png"
},
{
...groupBaseOption, "name": "๐Ÿ‡ท๐Ÿ‡บ RU", "type": "url-test", "include-all": true,
"filter": createFilterRegex(['ไฟ„็ฝ—ๆ–ฏ', 'Russia', 'RU', '๐Ÿ‡ท๐Ÿ‡บ']),
"exclude-filter": regionalExcludeFilter, "tolerance": 50, "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Russia.png"
},
// --- Service Groups ---
{
...groupBaseOption, "name": "Apple", "type": "select", "proxies": ["DIRECT", "๐ŸŒ Proxy", ...regionalGroupNames, "REJECT"],
"include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|้ข‘้“|่ฎข้˜…|ISP|ๆต้‡|ๅˆฐๆœŸ|้‡็ฝฎ", "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Apple.png"
},
{
...groupBaseOption, "name": "Telegram", "type": "select", "proxies": ["๐ŸŒ Proxy", ...regionalGroupNames, "DIRECT", "REJECT"],
"include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|้ข‘้“|่ฎข้˜…|ISP|ๆต้‡|ๅˆฐๆœŸ|้‡็ฝฎ", "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Telegram.png"
},
{
...groupBaseOption, "name": "YouTube", "type": "select", "proxies": ["๐ŸŒ Proxy", ...regionalGroupNames, "DIRECT", "REJECT"],
"include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|้ข‘้“|่ฎข้˜…|ISP|ๆต้‡|ๅˆฐๆœŸ|้‡็ฝฎ", "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/YouTube.png"
},
{
...groupBaseOption, "name": "BiliBili", "type": "select", "proxies": ["DIRECT", "๐ŸŒ Proxy", "REJECT", ...regionalGroupNames],
"include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|้ข‘้“|่ฎข้˜…|ISP|ๆต้‡|ๅˆฐๆœŸ|้‡็ฝฎ", "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/bilibili.png"
},
{
...groupBaseOption, "name": "OpenAI", "type": "select", "proxies": ["๐ŸŒ Proxy", "๐Ÿ‡บ๐Ÿ‡ธ US", "๐Ÿ‡น๐Ÿ‡ผ TW", "๐Ÿ‡ฏ๐Ÿ‡ต JP", "๐Ÿ‡ฐ๐Ÿ‡ท KR", "๐Ÿ‡ญ๐Ÿ‡ฐ HK", ...regionalGroupNames, "DIRECT"],
"include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|้ข‘้“|่ฎข้˜…|ISP|ๆต้‡|ๅˆฐๆœŸ|้‡็ฝฎ", "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/ChatGPT.png"
},
{
...groupBaseOption, "name": "Gemini", "type": "select", "proxies": ["๐ŸŒ Proxy", ...regionalGroupNames, "DIRECT"],
"include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|้ข‘้“|่ฎข้˜…|ISP|ๆต้‡|ๅˆฐๆœŸ|้‡็ฝฎ", "icon": "https://cdn.jsdelivr.net/gh/guaishouxiaoqi/icons@master/Color/Gemini.png"
},
{
...groupBaseOption, "name": "Claude", "type": "select", "proxies": ["๐ŸŒ Proxy", "๐Ÿ‡บ๐Ÿ‡ธ US", "๐Ÿ‡ฌ๐Ÿ‡ง UK", ...regionalGroupNames, "DIRECT"],
"include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|้ข‘้“|่ฎข้˜…|ISP|ๆต้‡|ๅˆฐๆœŸ|้‡็ฝฎ", "icon": "https://cdn.jsdelivr.net/gh/ke1ewang/Qi@master/Claude.png"
},
{
...groupBaseOption, "name": "TikTok", "type": "select", "proxies": ["๐ŸŒ Proxy", "๐Ÿ‡น๐Ÿ‡ผ TW", "๐Ÿ‡ญ๐Ÿ‡ฐ HK", "๐Ÿ‡ฏ๐Ÿ‡ต JP", "๐Ÿ‡ฐ๐Ÿ‡ท KR", "๐Ÿ‡บ๐Ÿ‡ธ US", ...regionalGroupNames, "DIRECT"],
"include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|้ข‘้“|่ฎข้˜…|ISP|ๆต้‡|ๅˆฐๆœŸ|้‡็ฝฎ", "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/TikTok.png"
},
{
...groupBaseOption, "name": "Spotify", "type": "select", "proxies": ["๐ŸŒ Proxy", ...regionalGroupNames, "DIRECT"],
"include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|้ข‘้“|่ฎข้˜…|ISP|ๆต้‡|ๅˆฐๆœŸ|้‡็ฝฎ", "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Spotify.png"
},
{
...groupBaseOption, "name": "Netflix", "type": "select", "proxies": ["๐ŸŒ Proxy", ...regionalGroupNames, "DIRECT"],
"include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|้ข‘้“|่ฎข้˜…|ISP|ๆต้‡|ๅˆฐๆœŸ|้‡็ฝฎ|ๅ›žๅ›ฝ|ไธญ่ฝฌ", "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Netflix.png"
},
{
...groupBaseOption, "name": "Disney", "type": "select", "proxies": ["๐ŸŒ Proxy", ...regionalGroupNames, "DIRECT"],
"include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|้ข‘้“|่ฎข้˜…|ISP|ๆต้‡|ๅˆฐๆœŸ|้‡็ฝฎ|ๅ›žๅ›ฝ|ไธญ่ฝฌ", "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Disney.png"
},
{
...groupBaseOption, "name": "Google", "type": "select", "proxies": ["๐ŸŒ Proxy", ...regionalGroupNames, "DIRECT"],
"include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|้ข‘้“|่ฎข้˜…|ISP|ๆต้‡|ๅˆฐๆœŸ|้‡็ฝฎ", "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Google.png"
},
{
...groupBaseOption, "name": "OneDrive", "type": "select", "proxies": ["DIRECT", "๐ŸŒ Proxy", ...regionalGroupNames],
"include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|้ข‘้“|่ฎข้˜…|ISP|ๆต้‡|ๅˆฐๆœŸ|้‡็ฝฎ", "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/OneDrive.png"
},
{
...groupBaseOption, "name": "Microsoft", "type": "select", "proxies": ["DIRECT", "๐ŸŒ Proxy", "REJECT", ...regionalGroupNames],
"include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|้ข‘้“|่ฎข้˜…|ISP|ๆต้‡|ๅˆฐๆœŸ|้‡็ฝฎ", "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Microsoft.png"
},
{
...groupBaseOption, "name": "Twitter", "type": "select", "proxies": ["๐ŸŒ Proxy", ...regionalGroupNames, "DIRECT"],
"include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|้ข‘้“|่ฎข้˜…|ISP|ๆต้‡|ๅˆฐๆœŸ|้‡็ฝฎ", "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Twitter.png"
},
{
...groupBaseOption, "name": "Emby", "type": "select", "proxies": ["๐ŸŒ Proxy", ...regionalGroupNames, "DIRECT"],
"include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|้ข‘้“|่ฎข้˜…|ISP|ๆต้‡|ๅˆฐๆœŸ|้‡็ฝฎ", "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Emby.png"
},
{
...groupBaseOption, "name": "Steam", "type": "select", "proxies": ["๐ŸŒ Proxy", "๐Ÿ‡ญ๐Ÿ‡ฐ HK", "DIRECT", ...regionalGroupNames],
"include-all": true, "exclude-filter": "(?i)GB|Traffic|Expire|Premium|้ข‘้“|่ฎข้˜…|ISP|ๆต้‡|ๅˆฐๆœŸ|้‡็ฝฎ", "icon": "https://cdn.jsdelivr.net/gh/Koolson/Qure@master/IconSet/Color/Steam.png"
}
];
}
// ่ง„ๅˆ™้›†้€š็”จ้…็ฝฎ
const ruleProviderCommon = {
"type": "http", "format": "yaml", "interval": 86400, "proxy": "๐ŸŒ Proxy"
};
// ่ง„ๅˆ™้›†้…็ฝฎ
const ruleProviders = {
"Apple": { ...ruleProviderCommon, "behavior": "classical", "url": "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Apple/Apple_Classical.yaml", "path": "./ruleset/Apple.yaml" },
"Telegram": { ...ruleProviderCommon, "behavior": "classical", "url": "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Telegram/Telegram.yaml", "path": "./ruleset/Telegram.yaml" },
"YouTube": { ...ruleProviderCommon, "behavior": "classical", "url": "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/YouTube/YouTube.yaml", "path": "./ruleset/YouTube.yaml" },
"BiliBili": { ...ruleProviderCommon, "behavior": "classical", "url": "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/BiliBili/BiliBili.yaml", "path": "./ruleset/BiliBili.yaml" },
"TikTok": { ...ruleProviderCommon, "behavior": "classical", "url": "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/TikTok/TikTok.yaml", "path": "./ruleset/TikTok.yaml" },
"Spotify": { ...ruleProviderCommon, "behavior": "classical", "url": "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Spotify/Spotify.yaml", "path": "./ruleset/Spotify.yaml" },
"Netflix": { ...ruleProviderCommon, "behavior": "classical", "url": "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Netflix/Netflix.yaml", "path": "./ruleset/Netflix.yaml" },
"Disney": { ...ruleProviderCommon, "behavior": "classical", "url": "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Disney/Disney.yaml", "path": "./ruleset/Disney.yaml" },
"Google": { ...ruleProviderCommon, "behavior": "classical", "url": "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Google/Google.yaml", "path": "./ruleset/Google.yaml" },
"OpenAI": { ...ruleProviderCommon, "behavior": "classical", "url": "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/OpenAI/OpenAI.yaml", "path": "./ruleset/OpenAI.yaml" },
"Microsoft": { ...ruleProviderCommon, "behavior": "classical", "url": "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Microsoft/Microsoft.yaml", "path": "./ruleset/Microsoft.yaml" },
"Twitter": { ...ruleProviderCommon, "behavior": "classical", "url": "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Twitter/Twitter.yaml", "path": "./ruleset/Twitter.yaml" },
"Steam": { ...ruleProviderCommon, "behavior": "classical", "url": "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Steam/Steam.yaml", "path": "./ruleset/Steam.yaml" },
"OneDrive": { ...ruleProviderCommon, "behavior": "classical", "url": "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/OneDrive/OneDrive.yaml", "path": "./ruleset/OneDrive.yaml" },
"Emby": { ...ruleProviderCommon, "behavior": "classical", "url": "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Emby/Emby.yaml", "path": "./ruleset/Emby.yaml" },
"Gemini": { ...ruleProviderCommon, "behavior": "classical", "url": "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Gemini/Gemini.yaml", "path": "./ruleset/Gemini.yaml" },
"Claude": { ...ruleProviderCommon, "behavior": "classical", "url": "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Claude/Claude.yaml", "path": "./ruleset/Claude.yaml" },
"Github": { ...ruleProviderCommon, "behavior": "classical", "url": "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/GitHub/GitHub_No_Resolve.yaml", "path": "./ruleset/Github.yaml" },
};
// ่ง„ๅˆ™
const rules = [
"RULE-SET,Telegram,Telegram", "RULE-SET,YouTube,YouTube", "RULE-SET,BiliBili,BiliBili",
"RULE-SET,TikTok,TikTok", "RULE-SET,Spotify,Spotify", "RULE-SET,Netflix,Netflix",
"RULE-SET,Disney,Disney", "RULE-SET,Google,Google", "RULE-SET,OpenAI,OpenAI",
"RULE-SET,Microsoft,Microsoft", "RULE-SET,Twitter,Twitter", "RULE-SET,Steam,Steam",
"RULE-SET,OneDrive,OneDrive", "RULE-SET,Emby,Emby", "RULE-SET,Gemini,Gemini",
"RULE-SET,Claude,Claude",
"RULE-SET,Apple,Apple",
"DOMAIN-SUFFIX,push.apple.com,Apple",
// ๅฑ€ๅŸŸ็ฝ‘/ๅ†…้ƒจ่ง„ๅˆ™
"IP-CIDR,192.168.0.0/16,DIRECT",
"IP-CIDR,10.0.0.0/8,DIRECT",
"IP-CIDR,172.16.0.0/12,DIRECT",
"IP-CIDR,127.0.0.1/32,DIRECT",
"IP-CIDR,198.18.0.1/16,DIRECT", // Fake IP
"DOMAIN-SUFFIX,lan,DIRECT",
"DOMAIN-SUFFIX,local,DIRECT",
// ๅœฐ็†ไฝ็ฝฎ่ง„ๅˆ™
"GEOIP,LAN,DIRECT",
"GEOIP,CN,DIRECT",
// ๆœ€็ปˆๅŒน้…
"MATCH,๐ŸŒ Proxy"
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment