-
Notifications
You must be signed in to change notification settings - Fork 0
/
Clash verge rev Script.txt
177 lines (82 loc) · 2.79 KB
/
Clash verge rev Script.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
function main(content) {
const isObject = (value) => {
return value !== null && typeof value === 'object'
}
const mergeConfig = (existingConfig, newConfig) => {
if (!isObject(existingConfig)) {
existingConfig = {}
}
if (!isObject(newConfig)) {
return existingConfig
}
return { ...existingConfig, ...newConfig }
}
const cnDnsList = [
'https://223.5.5.5/dns-query',
'https://223.6.6.6/dns-query',
]
const trustDnsList = [
'quic://dns.cooluc.com',
'https://doh.apad.pro/dns-query',
'https://1.0.0.1/dns-query',
]
const notionDns = 'tls://dns.jerryw.cn'
const notionUrls = [
'http-inputs-notion.splunkcloud.com',
'+.notion-static.com',
'+.notion.com',
'+.notion.new',
'+.notion.site',
'+.notion.so',
]
const combinedUrls = notionUrls.join(',');
const dnsOptions = {
'enable': true,
'prefer-h3': true, // 如果DNS服务器支持DoH3会优先使用h3
'default-nameserver': cnDnsList, // 用于解析其他DNS服务器、和节点的域名, 必须为IP, 可为加密DNS。注意这个只用来解析节点和其他的dns,其他网络请求不归他管
'nameserver': trustDnsList, // 其他网络请求都归他管
// 这个用于覆盖上面的 nameserver
'nameserver-policy': {
[combinedUrls]: notionDns,
'geosite:geolocation-!cn': trustDnsList,
// 如果你有一些内网使用的DNS,应该定义在这里,多个域名用英文逗号分割
// '+.公司域名.com, www.4399.com, +.baidu.com': '10.0.0.1'
},
}
// GitHub加速前缀
const githubPrefix = 'https://fastgh.lainbo.com/'
// GEO数据GitHub资源原始下载地址
const rawGeoxURLs = {
geoip: 'https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip-lite.dat',
geosite: 'https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat',
mmdb: 'https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/country-lite.mmdb',
}
// 生成带有加速前缀的GEO数据资源对象
const accelURLs = Object.fromEntries(
Object.entries(rawGeoxURLs).map(([key, githubUrl]) => [key, `${githubPrefix}${githubUrl}`]),
)
const otherOptions = {
'unified-delay': true,
'tcp-concurrent': true,
'profile': {
'store-selected': true,
'store-fake-ip': true,
},
'sniffer': {
enable: true,
sniff: {
TLS: {
ports: [443, 8443],
},
HTTP: {
'ports': [80, '8080-8880'],
'override-destination': true,
},
},
},
'geodata-mode': true,
'geox-url': accelURLs,
}
content.dns = mergeConfig(content.dns, dnsOptions)
return { ...content, ...otherOptions }
}