1
1
import yaml from 'js-yaml' ;
2
2
3
3
export const SING_BOX_CONFIG = {
4
- log : {
5
- disabled : false ,
6
- level : 'info' ,
7
- timestamp : true ,
4
+ log : {
5
+ disabled : false ,
6
+ level : 'info' ,
7
+ timestamp : true ,
8
8
} ,
9
9
dns : {
10
10
"servers" : [
@@ -71,14 +71,13 @@ export const SING_BOX_CONFIG = {
71
71
"inet4_range" : "198.18.0.0/15"
72
72
}
73
73
} ,
74
- ntp : {
74
+ ntp : {
75
75
"enabled" : true ,
76
76
"server" : "time.apple.com" ,
77
77
"server_port" : 123 ,
78
78
"interval" : "30m" ,
79
79
"detour" : "DIRECT"
80
80
} ,
81
-
82
81
inbounds : [
83
82
{
84
83
"type" : "mixed" ,
@@ -96,7 +95,7 @@ export const SING_BOX_CONFIG = {
96
95
"sniff" : true
97
96
}
98
97
] ,
99
-
98
+
100
99
outbounds : [
101
100
{
102
101
"type" : "direct" ,
@@ -112,108 +111,116 @@ export const SING_BOX_CONFIG = {
112
111
}
113
112
] ,
114
113
115
- "route" : {
116
- "rules" : [
117
- {
118
- "protocol" : "dns" ,
119
- "port" : 53 ,
120
- "outbound" : "dns-out"
121
- } ,
122
- {
123
- "clash_mode" : "direct" ,
124
- "outbound" : "DIRECT"
125
- } ,
126
- {
127
- "clash_mode" : "global" ,
128
- "outbound" : "GLOBAL"
129
- } ,
130
- {
131
- "geosite" : "category-ads-all" ,
132
- "outbound" : "🛑 广告拦截"
133
- } ,
134
- {
135
- "geosite" : "openai" ,
136
- "outbound" : "💬 OpenAi"
137
- } ,
138
- {
139
- "geosite" : "biliintl" ,
140
- "outbound" : "📺 哔哩哔哩国际"
141
- } ,
142
- {
143
- "geosite" : "twitter" ,
144
- "outbound" : "🌍 国外媒体"
145
- } ,
146
- {
147
- "geosite" : "spotify" ,
148
- "outbound" : "🌍 国外媒体"
149
- } ,
150
- {
151
- "geosite" : "youtube" ,
152
- "outbound" : "📹 油管视频"
153
- } ,
154
- {
155
- "geosite" : "github" ,
156
- "outbound" : "🐱 GitHub"
157
- } ,
158
- {
159
- "geosite" : "google" ,
160
- "outbound" : "🔍 谷歌服务"
161
- } ,
162
- {
163
- "geosite" : "telegram" ,
164
- "outbound" : "📲 电报消息"
165
- } ,
166
- {
167
- "geosite" : "netflix" ,
168
- "outbound" : "🎥 奈飞视频"
169
- } ,
170
- {
171
- "geosite" : "bahamut" ,
172
- "outbound" : "📺 巴哈姆特"
173
- } ,
174
- {
175
- "geosite" : "geolocation-!cn" ,
176
- "outbound" : "🌍 国外媒体"
177
- } ,
178
- {
179
- "geoip" : "google" ,
180
- "outbound" : "🔍 谷歌服务"
181
- } ,
182
- {
183
- "geoip" : "netflix" ,
184
- "outbound" : "🎥 奈飞视频"
185
- } ,
186
- {
187
- "geoip" : "telegram" ,
188
- "outbound" : "📲 电报消息"
189
- } ,
190
- {
191
- "geoip" : "twitter" ,
192
- "outbound" : "🌍 国外媒体"
193
- } ,
194
- {
195
- "geosite" : "pixiv" ,
196
- "outbound" : "🌍 国外媒体"
197
- } ,
198
- {
199
- "geosite" : "CN" ,
200
- "outbound" : "🇨🇳 国内服务"
201
- } ,
202
- {
203
- "geoip" : "CN" ,
204
- "outbound" : "🇨🇳 国内服务"
205
- }
206
-
207
- ] ,
208
- "final" : "🐟 漏网之鱼" ,
209
- "auto_detect_interface" : true ,
210
- "geoip" : {
211
- "download_detour" : "proxy"
212
- } ,
213
- "geosite" : {
214
- "download_detour" : "proxy"
114
+ "route" : {
115
+ "rules" : [
116
+ {
117
+ "protocol" : "dns" ,
118
+ "port" : 53 ,
119
+ "outbound" : "dns-out"
120
+ } ,
121
+ {
122
+ "clash_mode" : "direct" ,
123
+ "outbound" : "DIRECT"
124
+ } ,
125
+ {
126
+ "clash_mode" : "global" ,
127
+ "outbound" : "GLOBAL"
128
+ } ,
129
+ { "rule_set" : [ "ads" ] , "outbound" : "🛑 广告拦截" } ,
130
+ { "ip_is_private" : true , "outbound" : "🔒 私有网络" } ,
131
+ { "rule_set" : [ "google-cn" ] , "outbound" : "🇬 谷歌服务" } ,
132
+ { "rule_set" : [ "netflix" ] , "outbound" : "🎥 奈飞视频" } ,
133
+ { "rule_set" : [ "youtube" ] , "outbound" : "📹 油管视频" } ,
134
+ { "rule_set" : [ "bilibili" ] , "outbound" : "📺 哔哩哔哩" } ,
135
+ { "rule_set" : [ "ai" ] , "outbound" : "💬 OpenAI" } ,
136
+ { "rule_set" : [ "cn" ] , "outbound" : "🇨🇳 国内服务" } ,
137
+ { "rule_set" : [ "netflixip" ] , "outbound" : "🎥 奈飞视频" } ,
138
+ { "rule_set" : [ "telegramip" ] , "outbound" : "📲 电报消息" } ,
139
+ { "ip_is_private" : true , "outbound" : "🔒 私有网络" } ,
140
+ { "rule_set" : [ "cnip" ] , "outbound" : "🇨🇳 国内服务" } ,
141
+ ] ,
142
+ "auto_detect_interface" : true ,
143
+ "final" : "🐟 漏网之鱼" ,
144
+ "rule_set" : [
145
+ {
146
+ "tag" : "ads" ,
147
+ "type" : "remote" ,
148
+ "format" : "binary" ,
149
+ "url" : "https://github.com/lyc8503/sing-box-rules/raw/rule-set-geosite/geosite-adblockplus.srs" ,
150
+ "download_detour" : "⚡ 自动选择"
151
+ } ,
152
+ {
153
+ "tag" : "google-cn" ,
154
+ "type" : "remote" ,
155
+ "format" : "binary" ,
156
+ "url" : "https://github.com/lyc8503/sing-box-rules/raw/rule-set-geosite/geosite-google.srs" ,
157
+ "download_detour" : "⚡ 自动选择"
158
+ } ,
159
+ {
160
+ "tag" : "netflix" ,
161
+ "type" : "remote" ,
162
+ "format" : "binary" ,
163
+ "url" : "https://github.com/lyc8503/sing-box-rules/raw/rule-set-geosite/geosite-netflix.srs" ,
164
+ "download_detour" : "⚡ 自动选择"
165
+ } ,
166
+ {
167
+ "tag" : "youtube" ,
168
+ "type" : "remote" ,
169
+ "format" : "binary" ,
170
+ "url" : "https://github.com/lyc8503/sing-box-rules/raw/rule-set-geosite/geosite-youtube.srs" ,
171
+ "download_detour" : "⚡ 自动选择"
172
+ } ,
173
+ {
174
+ "tag" : "bilibili" ,
175
+ "type" : "remote" ,
176
+ "format" : "binary" ,
177
+ "url" : "https://github.com/lyc8503/sing-box-rules/raw/rule-set-geosite/geosite-bilibili.srs" ,
178
+ "download_detour" : "⚡ 自动选择"
179
+ } ,
180
+ {
181
+ "tag" : "ai" ,
182
+ "type" : "remote" ,
183
+ "format" : "binary" ,
184
+ "url" : "https://github.com/lyc8503/sing-box-rules/raw/rule-set-geosite/geosite-openai.srs" ,
185
+ "download_detour" : "⚡ 自动选择"
186
+ } ,
187
+ {
188
+ "tag" : "cn" ,
189
+ "type" : "remote" ,
190
+ "format" : "binary" ,
191
+ "url" : "https://github.com/lyc8503/sing-box-rules/raw/rule-set-geosite/geosite-cn.srs" ,
192
+ "download_detour" : "⚡ 自动选择"
193
+ } ,
194
+ {
195
+ "tag" : "netflixip" ,
196
+ "type" : "remote" ,
197
+ "format" : "binary" ,
198
+ "url" : "https://github.com/lyc8503/sing-box-rules/raw/rule-set-geosite/geoip-netflix.srs" ,
199
+ "download_detour" : "⚡ 自动选择"
200
+ } ,
201
+ {
202
+ "tag" : "telegramip" ,
203
+ "type" : "remote" ,
204
+ "format" : "binary" ,
205
+ "url" : "https://github.com/lyc8503/sing-box-rules/raw/rule-set-geosite/geoip-telegram.srs" ,
206
+ "download_detour" : "⚡ 自动选择"
207
+ } ,
208
+ {
209
+ "tag" : "cnip" ,
210
+ "type" : "remote" ,
211
+ "format" : "binary" ,
212
+ "url" : "https://github.com/lyc8503/sing-box-rules/raw/rule-set-geosite/geoip-cn.srs" ,
213
+ "download_detour" : "⚡ 自动选择"
214
+ } ,
215
+ {
216
+ "tag" : "geosite-geolocation-!cn" ,
217
+ "type" : "remote" ,
218
+ "format" : "binary" ,
219
+ "url" : "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-!cn.srs" ,
220
+ "download_detour" : "⚡ 自动选择"
221
+ } ,
222
+ ]
215
223
} ,
216
- } ,
217
224
218
225
experimental : {
219
226
"cache_file" : {
@@ -226,49 +233,47 @@ export const SING_BOX_CONFIG = {
226
233
}
227
234
}
228
235
}
229
- export const SELECTORS_LIST = [ '🚀 节点选择' , '🛑 广告拦截' , '🌍 国外媒体' , '🇨🇳 国内服务' , '📲 电报消息' , '💬 OpenAi ' , '📹 油管视频' , '🎥 奈飞视频' , '📺 巴哈姆特 ' , '📺 哔哩哔哩国际' , '🔍 谷歌服务' , '🐱 GitHub ', '🐟 漏网之鱼' , 'GLOBAL' ]
236
+ export const SELECTORS_LIST = [ '🚀 节点选择' , '🛑 广告拦截' , '🌍 国外媒体' , '🔒 私有网络' , ' 🇨🇳 国内服务', '📲 电报消息' , '💬 OpenAI ' , '📹 油管视频' , '🎥 奈飞视频' , '📺 哔哩哔哩 ' , '🇬 谷歌服务' , '🐟 漏网之鱼' , 'GLOBAL' ]
230
237
231
238
export const CLASH_RULES = `
232
239
# - AND,(AND,(DST-PORT,443),(NETWORK,UDP)),(NOT,((GEOSITE,cn))),REJECT # quic
233
-
234
240
- GEOSITE,category-ads-all,🛑 广告拦截
235
- - GEOSITE,openai, 💬 OpenAi
236
- - GEOSITE,biliintl, 📺 哔哩哔哩国际
241
+ - GEOSITE,openai,💬 OpenAI
242
+ - GEOSITE,biliintl,📺 哔哩哔哩
243
+ - GEOSITE,bilibili,📺 哔哩哔哩
237
244
- GEOSITE,twitter,🌍 国外媒体
238
245
- GEOSITE,spotify,🌍 国外媒体
239
246
- GEOSITE,youtube,📹 油管视频
240
- - GEOSITE,github, 🐱 GitHub
241
- - GEOSITE,google, 🔍 谷歌服务
247
+ - GEOSITE,google,🇬 谷歌服务
242
248
- GEOSITE,telegram,📲 电报消息
243
249
- GEOSITE,netflix,🎥 奈飞视频
244
- - GEOSITE,bahamut,📺 巴哈姆特
245
250
- GEOSITE,geolocation-!cn,🌍 国外媒体
246
-
247
251
# - AND,(AND,(DST-PORT,443),(NETWORK,UDP)),(NOT,((GEOIP,CN))),REJECT # quic
248
- - GEOIP,google,🔍 谷歌服务
252
+ - GEOIP,private,🔒 私有网络
253
+ - GEOIP,google,🇬 谷歌服务
249
254
- GEOIP,netflix,🎥 奈飞视频
250
255
- GEOIP,telegram,📲 电报消息
251
256
- GEOIP,twitter,🌍 国外媒体
252
257
- GEOSITE,pixiv,🌍 国外媒体
253
- - GEOSITE,CN, 🇨🇳 国内服务
258
+ - GEOSITE,CN,🇨🇳 国内服务
254
259
- GEOIP,CN,🇨🇳 国内服务
255
260
- MATCH,🐟 漏网之鱼,🚀 节点选择
256
- `;
261
+ ` ;
257
262
258
263
const parsedRules = yaml . load ( CLASH_RULES ) ;
259
264
260
265
export const CLASH_CONFIG = {
261
- port : 7890 ,
262
- 'socks-port' : 7891 ,
263
- 'allow-lan' : false ,
264
- mode : 'Rule' ,
265
- 'log-level' : 'info' ,
266
+ port : 7890 ,
267
+ 'socks-port' : 7891 ,
268
+ 'allow-lan' : false ,
269
+ mode : 'Rule' ,
270
+ 'log-level' : 'info' ,
266
271
dns : {
267
272
enable : true ,
268
273
nameserver : [ '119.29.29.29' , '223.5.5.5' ] ,
269
274
fallback : [ '8.8.8.8' , '8.8.4.4' , 'tls://1.0.0.1:853' , 'tls://dns.google:853' ] ,
270
275
} ,
271
- proxies : [ ] ,
272
- 'proxy-groups' : [ ] ,
276
+ proxies : [ ] ,
277
+ 'proxy-groups' : [ ] ,
273
278
rules : parsedRules ,
274
279
} ;
0 commit comments