mirror of
https://github.com/lush2020/edgetunnel.git
synced 2026-03-22 01:22:21 +08:00
21
_worker.js
21
_worker.js
@@ -803,11 +803,15 @@ function Clash订阅配置文件热补丁(Clash_原始订阅内容, uuid = null,
|
||||
- 208.67.220.220
|
||||
fallback-filter:
|
||||
geoip: true
|
||||
domain: [+.google.com, +.facebook.com, +.youtube.com]
|
||||
geoip-code: CN
|
||||
ipcidr:
|
||||
- 240.0.0.0/4
|
||||
- 127.0.0.1/32
|
||||
- 0.0.0.0/32
|
||||
geoip-code: CN
|
||||
domain:
|
||||
- '+.google.com'
|
||||
- '+.facebook.com'
|
||||
- '+.youtube.com'
|
||||
`;
|
||||
|
||||
// 检查是否存在 dns: 字段(可能在任意行,行首无缩进)
|
||||
@@ -1508,9 +1512,16 @@ async function 读取config_JSON(env, hostname, userID, 重置配置 = false) {
|
||||
}
|
||||
|
||||
async function 生成随机IP(request, count = 16, 指定端口 = -1) {
|
||||
const asnMap = { '9808': 'cmcc', '4837': 'cu', '17623': 'cu', '4134': 'ct' }, asn = request.cf.asn;
|
||||
const cidr_url = asnMap[asn] ? `https://raw.githubusercontent.com/cmliu/cmliu/main/CF-CIDR/${asnMap[asn]}.txt` : 'https://raw.githubusercontent.com/cmliu/cmliu/main/CF-CIDR.txt';
|
||||
const cfname = { '9808': 'CF移动优选', '4837': 'CF联通优选', '17623': 'CF联通优选', '4134': 'CF电信优选' }[asn] || 'CF官方优选';
|
||||
const ISP配置 = {
|
||||
'9808': { file: 'cmcc', name: 'CF移动优选' },
|
||||
'4837': { file: 'cu', name: 'CF联通优选' },
|
||||
'17623': { file: 'cu', name: 'CF联通优选' },
|
||||
'17816': { file: 'cu', name: 'CF联通优选' },
|
||||
'4134': { file: 'ct', name: 'CF电信优选' },
|
||||
};
|
||||
const asn = request.cf.asn, isp = ISP配置[asn];
|
||||
const cidr_url = isp ? `https://raw.githubusercontent.com/cmliu/cmliu/main/CF-CIDR/${isp.file}.txt` : 'https://raw.githubusercontent.com/cmliu/cmliu/main/CF-CIDR.txt';
|
||||
const cfname = isp?.name || 'CF官方优选';
|
||||
const cfport = [443, 2053, 2083, 2087, 2096, 8443];
|
||||
let cidrList = [];
|
||||
try { const res = await fetch(cidr_url); cidrList = res.ok ? await 整理成数组(await res.text()) : ['104.16.0.0/13']; } catch { cidrList = ['104.16.0.0/13']; }
|
||||
|
||||
Reference in New Issue
Block a user