Skip to content

Commit bb6faa3

Browse files
committed
Update serverless_for_Iran.jsonc
Use DNS new features; change fragment parameters; some improvements
1 parent 070b65e commit bb6faa3

1 file changed

Lines changed: 83 additions & 47 deletions

File tree

Serverless-for-Iran/serverless_for_Iran.jsonc

Lines changed: 83 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"remarks": "Serverless",
77

88
"version": {
9-
"min": "25.9.5"
9+
"min": "25.12.8"
1010
},
1111

1212
"log": {
@@ -22,42 +22,53 @@
2222
}
2323
},
2424

25+
"fakedns": [
26+
{
27+
"ipPool": "198.19.0.0/16",
28+
"poolSize": 65535
29+
},
30+
{
31+
"ipPool": "fc00:2000::/19",
32+
"poolSize": 65535
33+
}
34+
],
35+
2536
"dns":{
2637
"hosts": {
2738
"geosite:category-ads-all": "#3",
28-
"one.one.one.one": ["1.1.1.1", "1.0.0.1", "2606:4700:4700::1111", "2606:4700:4700::1001"],
29-
"cloudflare-dns.com": "www.cloudflare.com"
39+
"cloudflare-dns.com": "challenges.cloudflare.com"
3040
},
3141
"servers": [
3242
{
3343
"address": "fakedns",
34-
"domains": ["domain:ir", "geosite:private", "geosite:category-ir", "full:www.cloudflare.com"],
35-
"finalQuery": true
44+
"domains": ["domain:ir", "geosite:private", "geosite:category-ir", "full:challenges.cloudflare.com"]
3645
},
3746
{
3847
"tag": "no-filter-dns",
3948
"address": "https://cloudflare-dns.com/dns-query",
40-
"timeoutMs": 5000,
49+
"timeoutMs": 10000,
4150
"finalQuery": true
4251
},
4352
{
4453
"address": "localhost",
45-
"domains": ["domain:ir", "geosite:private", "geosite:category-ir", "full:www.cloudflare.com"],
54+
"domains": ["domain:ir", "geosite:private", "geosite:category-ir", "full:challenges.cloudflare.com"],
4655
"finalQuery": true
4756
}
4857
],
4958
"queryStrategy": "UseSystem",
50-
"useSystemHosts": true
59+
"useSystemHosts": true,
60+
"serveStale": true,
61+
"serveExpiredTTL": 21600
5162
},
5263

5364
"inbounds": [
5465
{
5566
"tag": "dns-in",
56-
"listen": "127.0.0.1",
67+
// "listen": "127.0.0.1",
5768
"port": 10853,
5869
"protocol": "tunnel",
5970
"settings": {
60-
"address": "one.one.one.one",
71+
"address": "127.0.0.1",
6172
"port": 53,
6273
"network": "tcp,udp"
6374
},
@@ -69,8 +80,8 @@
6980
}
7081
},
7182
{
72-
"tag": "socks-in",
73-
"listen": "127.0.0.1",
83+
"tag": "mixed-in",
84+
// "listen": "127.0.0.1",
7485
"port": 10808,
7586
"protocol": "mixed",
7687
"sniffing": {
@@ -97,27 +108,46 @@
97108
"protocol": "block"
98109
},
99110
{
100-
"tag": "direct-out",
111+
"tag": "tcp-direct-out",
101112
"protocol": "direct",
102113
"streamSettings": {
103114
"sockopt": {
104115
"domainStrategy": "ForceIP",
105116
"happyEyeballs": {
106-
"tryDelayMs": 100,
117+
"tryDelayMs": 300,
107118
"prioritizeIPv6": true,
108119
"interleave": 2,
109-
"maxConcurrentTry": 16
120+
"maxConcurrentTry": 20
110121
}
111122
}
112123
}
113124
},
125+
{
126+
"tag": "udp-direct-out",
127+
"protocol": "direct",
128+
"settings": {
129+
"targetStrategy": "ForceIPv6v4"
130+
}
131+
},
114132
{
115133
"tag": "dns-out",
116134
"protocol": "dns",
117-
"settings": {"nonIPQuery": "skip", "network": "tcp", "address": "one.one.one.one", "port": 53},
135+
"settings": {"nonIPQuery": "reject", "blockTypes": [0, 65]}
136+
},
137+
{
138+
"tag": "tls-fragment",
139+
"protocol": "direct",
140+
"settings": {
141+
"fragment": {
142+
"packets": "tlshello",
143+
"length": "6",
144+
"interval": "0",
145+
"maxSplit": "0"
146+
}
147+
},
118148
"streamSettings": {
119149
"sockopt": {
120-
"dialerProxy": "full-fragment"
150+
"dialerProxy": "full-fragment" // or "skip-fragment" (with different parameteres)
121151
}
122152
}
123153
},
@@ -128,7 +158,7 @@
128158
"fragment": {
129159
"packets": "1-1",
130160
"length": "130",
131-
"interval": "190",
161+
"interval": "560",
132162
"maxSplit": "4"
133163
}
134164
},
@@ -145,7 +175,7 @@
145175
"fragment": {
146176
"packets": "2-4",
147177
"length": "1",
148-
"interval": "1",
178+
"interval": "4",
149179
"maxSplit": "130"
150180
}
151181
},
@@ -156,7 +186,7 @@
156186
"tryDelayMs": 300,
157187
"prioritizeIPv6": true,
158188
"interleave": 2,
159-
"maxConcurrentTry": 16
189+
"maxConcurrentTry": 20
160190
}
161191
}
162192
}
@@ -168,7 +198,7 @@
168198
"fragment": {
169199
"packets": "1-1",
170200
"length": "1",
171-
"interval": "1",
201+
"interval": "4",
172202
"maxSplit": "517"
173203
}
174204
},
@@ -179,7 +209,7 @@
179209
"tryDelayMs": 300,
180210
"prioritizeIPv6": true,
181211
"interleave": 2,
182-
"maxConcurrentTry": 16
212+
"maxConcurrentTry": 20
183213
}
184214
}
185215
}
@@ -188,7 +218,7 @@
188218
"tag": "udp-noises",
189219
"protocol": "direct",
190220
"settings": {
191-
"targetStrategy": "ForceIP", // or "ForceIPv6v4" to prefer IPv6
221+
"targetStrategy": "ForceIPv6v4",
192222
"noises": [
193223
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
194224
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
@@ -223,49 +253,55 @@
223253
"domainStrategy": "IPOnDemand",
224254
"rules": [
225255
{"outboundTag": "block-out",
226-
"domain": ["geosite:category-ads-all"]
256+
"port": 0
257+
},
258+
{"outboundTag": "block-out",
259+
"domain": ["geosite:category-ads-all"]
227260
},
228261
{"outboundTag": "dns-out",
229-
"inboundTag": ["dns-in"]
262+
"inboundTag": ["dns-in"]
230263
},
231264
{"outboundTag": "dns-out",
232-
"inboundTag": ["socks-in"], "port": 53
265+
"inboundTag": ["mixed-in"], "port": 53
233266
},
234-
{"outboundTag": "full-fragment", // or "skip-fragment"
235-
"inboundTag": ["no-filter-dns"]
267+
{"outboundTag": "full-fragment", // or "skip-fragment" or "tls-fragment"
268+
"inboundTag": ["no-filter-dns"]
236269
},
237270
{"outboundTag": "block-out",
238-
"ip": ["0.0.0.0", "::"]
271+
"ip": ["10.10.34.0/24", "2001:4188:2:600::/64", "0.0.0.0", "::", "198.19.0.0/16", "fc00:2000::/19"]
239272
},
240-
{"outboundTag": "direct-out",
241-
"domain": ["domain:ir", "geosite:private", "geosite:category-ir"]
273+
{"outboundTag": "tcp-direct-out",
274+
"network": "tcp", "domain": ["domain:ir", "geosite:private", "geosite:category-ir"], "ip": ["0.0.0.0/0", "::/0"]
242275
},
243-
{"outboundTag": "direct-out",
244-
"ip": ["geoip:private", "geoip:ir"]
276+
{"outboundTag": "udp-direct-out",
277+
"network": "udp", "domain": ["domain:ir", "geosite:private", "geosite:category-ir"], "ip": ["0.0.0.0/0", "::/0"]
245278
},
246-
{"outboundTag": "udp-noises",
247-
"network": "udp", "protocol": ["quic"]
279+
{"outboundTag": "tcp-direct-out",
280+
"network": "tcp", "ip": ["geoip:private", "geoip:ir"]
281+
},
282+
{"outboundTag": "udp-direct-out",
283+
"network": "udp", "ip": ["geoip:private", "geoip:ir"]
248284
},
249285
{"outboundTag": "udp-noises",
250-
"network": "udp", "port": "443,2053,2083,2087,2096,8443"
286+
"network": "udp", "protocol": ["quic"], "ip": ["0.0.0.0/0", "::/0"]
251287
},
252-
{"outboundTag": "direct-out",
253-
"network": "udp"
288+
{"outboundTag": "udp-noises",
289+
"network": "udp", "port": "443", "ip": ["0.0.0.0/0", "::/0"]
254290
},
255-
{"outboundTag": "full-fragment", // or "skip-fragment"
256-
"network": "tcp", "protocol": ["tls"]
291+
{"outboundTag": "udp-direct-out",
292+
"network": "udp", "ip": ["0.0.0.0/0", "::/0"]
257293
},
258-
{"outboundTag": "full-fragment", // or "skip-fragment"
259-
"network": "tcp", "port": "443,2053,2083,2087,2096,8443"
294+
{"outboundTag": "full-fragment", // or "skip-fragment" or "tls-fragment"
295+
"network": "tcp", "protocol": ["tls"], "ip": ["0.0.0.0/0", "::/0"]
260296
},
261-
{"outboundTag": "full-fragment",
262-
"network": "tcp", "protocol": ["http"]
297+
{"outboundTag": "full-fragment", // or "skip-fragment" or "tls-fragment"
298+
"network": "tcp", "port": "443", "ip": ["0.0.0.0/0", "::/0"]
263299
},
264300
{"outboundTag": "full-fragment",
265-
"network": "tcp", "port": "80,8080,8880,2052,2082,2086,2095"
301+
"network": "tcp", "ip": ["0.0.0.0/0", "::/0"]
266302
},
267-
{"outboundTag": "full-fragment",
268-
"network": "tcp"
303+
{"outboundTag": "block-out",
304+
"port": "0-65535"
269305
}
270306
]
271307
}

0 commit comments

Comments
 (0)