From f5c80f5a38f9ff5804720445d9537dc038f208ec Mon Sep 17 00:00:00 2001 From: cmliu Date: Thu, 11 Dec 2025 03:25:52 +0800 Subject: [PATCH 1/8] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E5=8F=8D=E4=BB=A3=E4=BC=AA=E8=A3=85URL=EF=BC=8C=E7=A1=AE?= =?UTF-8?q?=E4=BF=9D=E6=9B=B4=E5=A5=BD=E7=9A=84=E5=8F=AF=E7=94=A8=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 98faab6..59c876d 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ | UUID | `90cd4a77-141a-43c9-991b-08263cfe9c10` |❌| 强制固定UUID | | PATH | `/` |❌| 强制固定路径 | | PROXYIP | `proxyip.cmliussss.net:443` |❌| 更换默认内置PROXYIP | -| URL | `https://blog.cmliussss.com` |❌| 主页反代伪装(乱设容易触发反诈,反代被墙的网站会加速域名被墙) | +| URL | `https://cloudflare-error-page-3th.pages.dev` |❌| 主页反代伪装(乱设容易触发反诈,反代被墙的网站会加速域名被墙) | | GO2SOCKS5 | `blog.cmliussss.com`,`*.ip111.cn`,`*google.com` |❌| 设置`SOCKS5`或`HTTP`变量之后,可设置强制使用socks5访问名单(设置为`*`可作为全局代理) | ## 🔧 实用技巧 From 84781a3c783734caf3deb90fcb703520645b16cc Mon Sep 17 00:00:00 2001 From: cmliu Date: Thu, 11 Dec 2025 17:30:56 +0800 Subject: [PATCH 2/8] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E6=B7=B7=E5=90=88?= =?UTF-8?q?=E8=AE=A2=E9=98=85=E7=94=9F=E6=88=90=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8D=E8=A7=84=E8=8C=83IP=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=A4=84=E7=90=86=EF=BC=8C=E5=A2=9E=E5=BC=BA=E8=AE=A2?= =?UTF-8?q?=E9=98=85=E5=86=85=E5=AE=B9=E7=9A=84=E5=AE=89=E5=85=A8=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _worker.js | 98 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 57 insertions(+), 41 deletions(-) diff --git a/_worker.js b/_worker.js index d06a56b..a572217 100644 --- a/_worker.js +++ b/_worker.js @@ -8,7 +8,7 @@ export default { const url = new URL(request.url); const UA = request.headers.get('User-Agent') || 'null'; const upgradeHeader = request.headers.get('Upgrade'); - const 管理员密码 = env.ADMIN || env.admin || env.PASSWORD || env.password || env.pswd || env.TOKEN || env.KEY; + const 管理员密码 = env.ADMIN || env.admin || env.PASSWORD || env.password || env.pswd || env.TOKEN || env.KEY || env.UUID || env.uuid; const 加密秘钥 = env.KEY || '勿动此默认密钥,有需求请自行通过添加变量KEY进行修改'; const userIDMD5 = await MD5MD5(管理员密码 + 加密秘钥); const uuidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/; @@ -229,53 +229,68 @@ export default { if (订阅类型 === 'mixed') { const 节点路径 = config_JSON.启用0RTT ? config_JSON.PATH + '?ed=2560' : config_JSON.PATH; const TLS分片参数 = config_JSON.TLS分片 == 'Shadowrocket' ? `&fragment=${encodeURIComponent('1,40-60,30-50,tlshello')}` : config_JSON.TLS分片 == 'Happ' ? `&fragment=${encodeURIComponent('3,1,tlshello')}` : ''; - const 完整优选列表 = config_JSON.优选订阅生成.本地IP库.随机IP ? (await 生成随机IP(request, config_JSON.优选订阅生成.本地IP库.随机数量, config_JSON.优选订阅生成.本地IP库.指定端口))[0] : await env.KV.get('ADD.txt') ? await 整理成数组(await env.KV.get('ADD.txt')) : (await 生成随机IP(request, config_JSON.优选订阅生成.本地IP库.随机数量, config_JSON.优选订阅生成.本地IP库.指定端口))[0]; - const 优选API = [], 优选IP = [], 其他节点 = []; - for (const 元素 of 完整优选列表) { - if (元素.toLowerCase().startsWith('https://')) 优选API.push(元素); - else if (元素.toLowerCase().includes('://')) 其他节点.push(元素); - else 优选IP.push(元素); - } - const 其他节点LINK = 其他节点.join('\n') + '\n'; + let 完整优选IP = [], 其他节点LINK = ''; + if (!url.searchParams.has('sub') && config_JSON.优选订阅生成.local) { // 本地生成订阅 + const 完整优选列表 = config_JSON.优选订阅生成.本地IP库.随机IP ? (await 生成随机IP(request, config_JSON.优选订阅生成.本地IP库.随机数量, config_JSON.优选订阅生成.本地IP库.指定端口))[0] : await env.KV.get('ADD.txt') ? await 整理成数组(await env.KV.get('ADD.txt')) : (await 生成随机IP(request, config_JSON.优选订阅生成.本地IP库.随机数量, config_JSON.优选订阅生成.本地IP库.指定端口))[0]; + const 优选API = [], 优选IP = [], 其他节点 = []; + for (const 元素 of 完整优选列表) { + if (元素.toLowerCase().startsWith('https://')) 优选API.push(元素); + else if (元素.toLowerCase().includes('://')) 其他节点.push(元素); + else 优选IP.push(元素); + } + 其他节点LINK = 其他节点.join('\n') + '\n'; const 优选API的IP = await 请求优选API(优选API); - const 完整优选IP = [...new Set(优选IP.concat(优选API的IP))]; - 订阅内容 = 完整优选IP.map(原始地址 => { - // 统一正则: 匹配 域名/IPv4/IPv6地址 + 可选端口 + 可选备注 - // 示例: - // - 域名: hj.xmm1993.top:2096#备注 或 example.com - // - IPv4: 166.0.188.128:443#Los Angeles 或 166.0.188.128 - // - IPv6: [2606:4700::]:443#CMCC 或 [2606:4700::] - const regex = /^(\[[\da-fA-F:]+\]|[\d.]+|[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?)*)(?::(\d+))?(?:#(.+))?$/; - const match = 原始地址.match(regex); - - let 节点地址, 节点端口 = "443", 节点备注; - - if (match) { - 节点地址 = match[1]; // IP地址或域名(可能带方括号) - 节点端口 = match[2] || "443"; // 端口,默认443 - 节点备注 = match[3] || 节点地址; // 备注,默认为地址本身 - } else { - // 不规范的格式,跳过处理返回null - console.warn(`[订阅内容] 不规范的IP格式已忽略: ${原始地址}`); - return null; - } - const 节点HOST = 随机替换通配符(host); - return `${协议类型}://${config_JSON.UUID}@${节点地址}:${节点端口}?security=tls&type=${config_JSON.传输协议}&host=${节点HOST}&sni=${节点HOST}&path=${encodeURIComponent(config_JSON.随机路径 ? 随机路径() + 节点路径 : 节点路径) + TLS分片参数}&encryption=none${config_JSON.跳过证书验证 ? '&allowInsecure=1' : ''}#${encodeURIComponent(节点备注)}`; - }).filter(item => item !== null).join('\n'); - 订阅内容 = btoa(其他节点LINK + 订阅内容); + 完整优选IP = [...new Set(优选IP.concat(优选API的IP))]; } else { // 优选订阅生成器 let 优选订阅生成器HOST = url.searchParams.get('sub') || config_JSON.优选订阅生成.SUB; 优选订阅生成器HOST = 优选订阅生成器HOST && !/^https?:\/\//i.test(优选订阅生成器HOST) ? `https://${优选订阅生成器HOST}` : 优选订阅生成器HOST; - const 优选订阅生成器URL = `${优选订阅生成器HOST}/sub?host=example.com&${协议类型 === ('v' + 'le' + 'ss') ? 'uuid' : 'pw'}=00000000-0000-4000-8000-000000000000&path=${encodeURIComponent(config_JSON.随机路径 ? 随机路径() + 节点路径 : 节点路径) + TLS分片参数}&type=${config_JSON.传输协议}`; + const 优选订阅生成器URL = `${优选订阅生成器HOST}/sub?host=example.com&uuid=00000000-0000-4000-8000-000000000000`; try { const response = await fetch(优选订阅生成器URL, { headers: { 'User-Agent': 'v2rayN/edge' + 'tunnel (https://github.com/cmliu/edge' + 'tunnel)' } }); - if (response.ok) 订阅内容 = btoa(其他节点LINK + atob(await response.text())); - else return new Response('优选订阅生成器异常:' + response.statusText, { status: response.status }); + if (!response.ok) return new Response('优选订阅生成器异常:' + response.statusText, { status: response.status }); + const 优选订阅生成器返回订阅内容 = atob(await response.text()); + const 订阅行列表 = 优选订阅生成器返回订阅内容.includes('\r\n') ? 优选订阅生成器返回订阅内容.split('\r\n') : 优选订阅生成器返回订阅内容.split('\n'); + for (const 行内容 of 订阅行列表) { + if (!行内容.trim()) continue; // 跳过空行 + if (行内容.includes('00000000-0000-4000-8000-000000000000') && 行内容.includes('example.com')) { // 这是优选IP行,提取 域名:端口#备注 + const 地址匹配 = 行内容.match(/:\/\/[^@]+@([^?]+)/); + if (地址匹配) { + let 地址端口 = 地址匹配[1], 备注 = ''; // 域名:端口 或 IP:端口 + const 备注匹配 = 行内容.match(/#(.+)$/); + if (备注匹配) 备注 = '#' + decodeURIComponent(备注匹配[1]); + 完整优选IP.push(地址端口 + 备注); + } + } else 其他节点LINK += 行内容 + '\n'; + } } catch (error) { return new Response('优选订阅生成器异常:' + error.message, { status: 403 }); } } + + 订阅内容 = 完整优选IP.map(原始地址 => { + // 统一正则: 匹配 域名/IPv4/IPv6地址 + 可选端口 + 可选备注 + // 示例: + // - 域名: hj.xmm1993.top:2096#备注 或 example.com + // - IPv4: 166.0.188.128:443#Los Angeles 或 166.0.188.128 + // - IPv6: [2606:4700::]:443#CMCC 或 [2606:4700::] + const regex = /^(\[[\da-fA-F:]+\]|[\d.]+|[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?)*)(?::(\d+))?(?:#(.+))?$/; + const match = 原始地址.match(regex); + + let 节点地址, 节点端口 = "443", 节点备注; + + if (match) { + 节点地址 = match[1]; // IP地址或域名(可能带方括号) + 节点端口 = match[2] || "443"; // 端口,默认443 + 节点备注 = match[3] || 节点地址; // 备注,默认为地址本身 + } else { + // 不规范的格式,跳过处理返回null + console.warn(`[订阅内容] 不规范的IP格式已忽略: ${原始地址}`); + return null; + } + + return `${协议类型}://00000000-0000-4000-8000-000000000000@${节点地址}:${节点端口}?security=tls&type=${config_JSON.传输协议}&host=example.com&sni=example.com&path=${encodeURIComponent(config_JSON.随机路径 ? 随机路径() + 节点路径 : 节点路径) + TLS分片参数}&encryption=none${config_JSON.跳过证书验证 ? '&allowInsecure=1' : ''}#${encodeURIComponent(节点备注)}`; + }).filter(item => item !== null).join('\n'); } else { // 订阅转换 const 订阅转换URL = `${config_JSON.订阅转换配置.SUBAPI}/sub?target=${订阅类型}&url=${encodeURIComponent(url.protocol + '//' + url.host + '/sub?target=mixed&token=' + 订阅TOKEN + (url.searchParams.has('sub') && url.searchParams.get('sub') != '' ? `&sub=${url.searchParams.get('sub')}` : ''))}&config=${encodeURIComponent(config_JSON.订阅转换配置.SUBCONFIG)}&emoji=${config_JSON.订阅转换配置.SUBEMOJI}&scv=${config_JSON.跳过证书验证}`; try { @@ -288,10 +303,11 @@ export default { return new Response('订阅转换后端异常:' + error.message, { status: 403 }); } } - if (订阅类型 === 'mixed') { - 订阅内容 = 批量替换域名(atob(订阅内容).replace(/00000000-0000-4000-8000-000000000000/g, config_JSON.UUID), host); - if (!ua.includes('mozilla')) 订阅内容 = btoa(订阅内容); - } else 订阅内容 = 批量替换域名(订阅内容.replace(/00000000-0000-4000-8000-000000000000/g, config_JSON.UUID), host); + + if (!ua.includes('subconverter')) 订阅内容 = 批量替换域名(订阅内容.replace(/00000000-0000-4000-8000-000000000000/g, config_JSON.UUID), host) + + if (!ua.includes('mozilla') && 订阅类型 === 'mixed') 订阅内容 = btoa(订阅内容); + if (订阅类型 === 'singbox') { 订阅内容 = JSON.stringify(JSON.parse(订阅内容), null, 2); responseHeaders["content-type"] = 'application/json; charset=utf-8'; From 1d65f6920211e26d47547048f6dfedacd102a00f Mon Sep 17 00:00:00 2001 From: cmliu Date: Thu, 11 Dec 2025 18:29:25 +0800 Subject: [PATCH 3/8] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0HOST=E5=A4=84?= =?UTF-8?q?=E7=90=86=E9=80=BB=E8=BE=91=EF=BC=8C=E6=94=AF=E6=8C=81=E5=A4=9A?= =?UTF-8?q?=E4=B8=AA=E4=B8=BB=E6=9C=BA=E5=B9=B6=E7=A1=AE=E4=BF=9D=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E4=B8=80=E8=87=B4=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _worker.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_worker.js b/_worker.js index a572217..413d028 100644 --- a/_worker.js +++ b/_worker.js @@ -14,7 +14,8 @@ export default { const uuidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/; const envUUID = env.UUID || env.uuid; const userID = (envUUID && uuidRegex.test(envUUID)) ? envUUID.toLowerCase() : [userIDMD5.slice(0, 8), userIDMD5.slice(8, 12), '4' + userIDMD5.slice(13, 16), '8' + userIDMD5.slice(17, 20), userIDMD5.slice(20)].join('-'); - const host = env.HOST ? env.HOST.toLowerCase().replace(/^https?:\/\//, '').split('/')[0].split(':')[0] : url.hostname; + const hosts = env.HOST ? (await 整理成数组(env.HOST)).map(h => h.toLowerCase().replace(/^https?:\/\//, '').split('/')[0].split(':')[0]) : [url.hostname]; + const host = hosts[0]; if (env.PROXYIP) { const proxyIPs = await 整理成数组(env.PROXYIP); 反代IP = proxyIPs[Math.floor(Math.random() * proxyIPs.length)]; From 7064f3751575f8bf2251610beb6db90db8831198 Mon Sep 17 00:00:00 2001 From: cmliu Date: Thu, 11 Dec 2025 18:42:30 +0800 Subject: [PATCH 4/8] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E5=9F=9F=E5=90=8D=E5=87=BD=E6=95=B0=EF=BC=8C?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=A4=9A=E4=B8=AA=E4=B8=BB=E6=9C=BA=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _worker.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_worker.js b/_worker.js index 413d028..c7e5bef 100644 --- a/_worker.js +++ b/_worker.js @@ -305,7 +305,7 @@ export default { } } - if (!ua.includes('subconverter')) 订阅内容 = 批量替换域名(订阅内容.replace(/00000000-0000-4000-8000-000000000000/g, config_JSON.UUID), host) + if (!ua.includes('subconverter')) 订阅内容 = 批量替换域名(订阅内容.replace(/00000000-0000-4000-8000-000000000000/g, config_JSON.UUID), hosts) if (!ua.includes('mozilla') && 订阅类型 === 'mixed') 订阅内容 = btoa(订阅内容); @@ -848,10 +848,10 @@ function 随机替换通配符(h) { }); } -function 批量替换域名(内容, host, 每组数量 = 2) { +function 批量替换域名(内容, hosts, 每组数量 = 2) { let count = 0, currentRandomHost = null; return 内容.replace(/example\.com/g, () => { - if (count % 每组数量 === 0) currentRandomHost = 随机替换通配符(host); + if (count % 每组数量 === 0) currentRandomHost = 随机替换通配符(hosts[Math.floor(Math.random() * hosts.length)]); count++; return currentRandomHost; }); From 538f89b2f037e58b54fc7912c04d10f2c1785cce Mon Sep 17 00:00:00 2001 From: cmliu Date: Thu, 11 Dec 2025 18:47:11 +0800 Subject: [PATCH 5/8] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0HOST=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E8=AF=B4=E6=98=8E=EF=BC=8C=E6=94=AF=E6=8C=81=E5=A4=9A?= =?UTF-8?q?=E5=85=83=E7=B4=A0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 59c876d..2b935d4 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ |--------|---------|-|-----| | ADMIN | `123456` |✅| 面板登录密码 | | KEY | `CMLiussss` |❌| 快速订阅密钥,访问`/CMLiussss`即可快读订阅。 | -| HOST | `edt-pages.github.io` |❌| 强制固定伪装域名 | +| HOST | `edt-pages.github.io` |❌| 强制固定伪装域名(支持多元素,使用`换行符`或`,`做间隔) | | UUID | `90cd4a77-141a-43c9-991b-08263cfe9c10` |❌| 强制固定UUID | | PATH | `/` |❌| 强制固定路径 | | PROXYIP | `proxyip.cmliussss.net:443` |❌| 更换默认内置PROXYIP | From f8156bbab751018600d89303c74138f954547d5d Mon Sep 17 00:00:00 2001 From: cmliu Date: Fri, 12 Dec 2025 00:56:20 +0800 Subject: [PATCH 6/8] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0README=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0Sukka=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2b935d4..839248e 100644 --- a/README.md +++ b/README.md @@ -184,4 +184,5 @@ - [白嫖哥](https://t.me/bestcfipas) - [Mingyu](https://github.com/ymyuuu/workers-vless) - [Alexandre Kojève](https://t.me/Enkelte_notif/784):stallTCP v1.3 -- [eooce](https://github.com/eooce/Cloudflare-proxy) \ No newline at end of file +- [eooce](https://github.com/eooce/Cloudflare-proxy) +- [Sukka](https://ip.skk.moe/) \ No newline at end of file From 0a591470c4f955a335f99959dee02bc2eaceb3f1 Mon Sep 17 00:00:00 2001 From: cmliu Date: Fri, 12 Dec 2025 13:57:19 +0800 Subject: [PATCH 7/8] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E5=9F=9F=E5=90=8D=E5=87=BD=E6=95=B0=EF=BC=8C?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E4=BB=8Econfig=5FJSON=E4=B8=AD=E8=8E=B7?= =?UTF-8?q?=E5=8F=96HOSTS=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _worker.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/_worker.js b/_worker.js index c7e5bef..5373cac 100644 --- a/_worker.js +++ b/_worker.js @@ -305,7 +305,7 @@ export default { } } - if (!ua.includes('subconverter')) 订阅内容 = 批量替换域名(订阅内容.replace(/00000000-0000-4000-8000-000000000000/g, config_JSON.UUID), hosts) + if (!ua.includes('subconverter')) 订阅内容 = 批量替换域名(订阅内容.replace(/00000000-0000-4000-8000-000000000000/g, config_JSON.UUID), config_JSON.HOSTS) if (!ua.includes('mozilla') && 订阅类型 === 'mixed') 订阅内容 = btoa(订阅内容); @@ -858,11 +858,13 @@ function 批量替换域名(内容, hosts, 每组数量 = 2) { } async function 读取config_JSON(env, hostname, userID, path, 重置配置 = false) { - const host = 随机替换通配符(hostname); + //const host = 随机替换通配符(hostname); + const host = hostname; const 初始化开始时间 = performance.now(); const 默认配置JSON = { TIME: new Date().toISOString(), HOST: host, + HOSTS: [hostname], UUID: userID, 协议类型: "v" + "le" + "ss", 传输协议: "ws", @@ -929,6 +931,8 @@ async function 读取config_JSON(env, hostname, userID, path, 重置配置 = fal } config_JSON.HOST = host; + if (!config_JSON.HOSTS) config_JSON.HOSTS = [hostname]; + if (env.HOST) config_JSON.HOSTS = (await 整理成数组(env.HOST)).map(h => h.toLowerCase().replace(/^https?:\/\//, '').split('/')[0].split(':')[0]); config_JSON.UUID = userID; config_JSON.PATH = path ? (path.startsWith('/') ? path : '/' + path) : (config_JSON.反代.SOCKS5.启用 ? ('/' + config_JSON.反代.SOCKS5.启用 + (config_JSON.反代.SOCKS5.全局 ? '://' : '=') + config_JSON.反代.SOCKS5.账号) : (config_JSON.反代.PROXYIP === 'auto' ? '/' : `/proxyip=${config_JSON.反代.PROXYIP}`)); const TLS分片参数 = config_JSON.TLS分片 == 'Shadowrocket' ? `&fragment=${encodeURIComponent('1,40-60,30-50,tlshello')}` : config_JSON.TLS分片 == 'Happ' ? `&fragment=${encodeURIComponent('3,1,tlshello')}` : ''; From b5efe79431c0a8d354ffa4241d76a475529c65a2 Mon Sep 17 00:00:00 2001 From: cmliu Date: Fri, 12 Dec 2025 14:09:33 +0800 Subject: [PATCH 8/8] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0SOCKS5=E5=8F=8D?= =?UTF-8?q?=E4=BB=A3=E9=80=BB=E8=BE=91=EF=BC=8C=E5=A2=9E=E5=8A=A0=E7=99=BD?= =?UTF-8?q?=E5=90=8D=E5=8D=95=E9=AA=8C=E8=AF=81=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _worker.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_worker.js b/_worker.js index 5373cac..a35d4f9 100644 --- a/_worker.js +++ b/_worker.js @@ -519,7 +519,8 @@ async function forwardataTCP(host, portNum, rawData, ws, respHeader, remoteConnW connectStreams(newSocket, ws, respHeader, null); } - if (启用SOCKS5反代 && 启用SOCKS5全局反代) { + const 验证SOCKS5白名单 = (addr) => SOCKS5白名单.some(p => new RegExp(`^${p.replace(/\*/g, '.*')}$`, 'i').test(addr)); + if (启用SOCKS5反代 && (启用SOCKS5全局反代 || 验证SOCKS5白名单(host))) { try { await connecttoPry(); } catch (err) {