Skip to content

Commit fc6077d

Browse files
committed
feat: Update wrangler.toml and README.md files
1 parent 309062a commit fc6077d

File tree

3 files changed

+135
-133
lines changed

3 files changed

+135
-133
lines changed

README.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222

2323
## 最近更新
2424

25+
### 3/8
26+
27+
- 适配Sing-Box的rule-set
28+
2529
### 31/7
2630

2731
- 支持 TUIC
@@ -31,12 +35,6 @@
3135
- 简化路由逻辑
3236
- 修复了一些小问题
3337

34-
### 28/7
35-
36-
- 新增对 HTTP/HTTPS 的 Base64 订阅链接的支持
37-
- 新增对 Trojan 协议的支持
38-
- 优化了页面引导和整体性能
39-
4038
## 部署
4139

4240
[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/7Sageer/sublink-worker)

src/config.js

+131-126
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import yaml from 'js-yaml';
22

33
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,
88
},
99
dns : {
1010
"servers": [
@@ -71,14 +71,13 @@ export const SING_BOX_CONFIG = {
7171
"inet4_range": "198.18.0.0/15"
7272
}
7373
},
74-
ntp : {
74+
ntp : {
7575
"enabled": true,
7676
"server": "time.apple.com",
7777
"server_port": 123,
7878
"interval": "30m",
7979
"detour": "DIRECT"
8080
},
81-
8281
inbounds : [
8382
{
8483
"type": "mixed",
@@ -96,7 +95,7 @@ export const SING_BOX_CONFIG = {
9695
"sniff": true
9796
}
9897
],
99-
98+
10099
outbounds : [
101100
{
102101
"type": "direct",
@@ -112,108 +111,116 @@ export const SING_BOX_CONFIG = {
112111
}
113112
],
114113

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+
]
215223
},
216-
},
217224

218225
experimental : {
219226
"cache_file": {
@@ -226,49 +233,47 @@ export const SING_BOX_CONFIG = {
226233
}
227234
}
228235
}
229-
export const SELECTORS_LIST = ['🚀 节点选择', '🛑 广告拦截', '🌍 国外媒体', '🇨🇳 国内服务', '📲 电报消息', '💬 OpenAi', '📹 油管视频', '🎥 奈飞视频', '📺 巴哈姆特', '📺 哔哩哔哩国际', '🔍 谷歌服务', '🐱 GitHub', '🐟 漏网之鱼', 'GLOBAL']
236+
export const SELECTORS_LIST = ['🚀 节点选择', '🛑 广告拦截', '🌍 国外媒体', '🔒 私有网络', '🇨🇳 国内服务', '📲 电报消息', '💬 OpenAI', '📹 油管视频', '🎥 奈飞视频', '📺 哔哩哔哩', '🇬 谷歌服务', '🐟 漏网之鱼', 'GLOBAL']
230237

231238
export const CLASH_RULES = `
232239
# - AND,(AND,(DST-PORT,443),(NETWORK,UDP)),(NOT,((GEOSITE,cn))),REJECT # quic
233-
234240
- GEOSITE,category-ads-all,🛑 广告拦截
235-
- GEOSITE,openai, 💬 OpenAi
236-
- GEOSITE,biliintl, 📺 哔哩哔哩国际
241+
- GEOSITE,openai,💬 OpenAI
242+
- GEOSITE,biliintl,📺 哔哩哔哩
243+
- GEOSITE,bilibili,📺 哔哩哔哩
237244
- GEOSITE,twitter,🌍 国外媒体
238245
- GEOSITE,spotify,🌍 国外媒体
239246
- GEOSITE,youtube,📹 油管视频
240-
- GEOSITE,github, 🐱 GitHub
241-
- GEOSITE,google, 🔍 谷歌服务
247+
- GEOSITE,google,🇬 谷歌服务
242248
- GEOSITE,telegram,📲 电报消息
243249
- GEOSITE,netflix,🎥 奈飞视频
244-
- GEOSITE,bahamut,📺 巴哈姆特
245250
- GEOSITE,geolocation-!cn,🌍 国外媒体
246-
247251
# - AND,(AND,(DST-PORT,443),(NETWORK,UDP)),(NOT,((GEOIP,CN))),REJECT # quic
248-
- GEOIP,google,🔍 谷歌服务
252+
- GEOIP,private,🔒 私有网络
253+
- GEOIP,google,🇬 谷歌服务
249254
- GEOIP,netflix,🎥 奈飞视频
250255
- GEOIP,telegram,📲 电报消息
251256
- GEOIP,twitter,🌍 国外媒体
252257
- GEOSITE,pixiv,🌍 国外媒体
253-
- GEOSITE,CN, 🇨🇳 国内服务
258+
- GEOSITE,CN,🇨🇳 国内服务
254259
- GEOIP,CN,🇨🇳 国内服务
255260
- MATCH,🐟 漏网之鱼,🚀 节点选择
256-
`;
261+
`;
257262

258263
const parsedRules = yaml.load(CLASH_RULES);
259264

260265
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',
266271
dns: {
267272
enable: true,
268273
nameserver: ['119.29.29.29', '223.5.5.5'],
269274
fallback: ['8.8.8.8', '8.8.4.4', 'tls://1.0.0.1:853', 'tls://dns.google:853'],
270275
},
271-
proxies: [],
272-
'proxy-groups': [],
276+
proxies: [],
277+
'proxy-groups': [],
273278
rules: parsedRules,
274279
};

wrangler.toml

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#:schema node_modules/wrangler/config-schema.json
22
name = "sublink-worker"
3-
usage_model = "bundled"
43
main = "src/index.js"
54
compatibility_date = "2024-07-24"
65
compatibility_flags = ["nodejs_compat"]

0 commit comments

Comments
 (0)