Skip to content

Commit a0f7957

Browse files
committed
Update Serverless for Iran
1 parent c7e8d28 commit a0f7957

File tree

2 files changed

+192
-118
lines changed

2 files changed

+192
-118
lines changed

Serverless-for-Iran/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Bypass censorship using TCP/TLS fragment and UDP noises.
1010

1111
It doesn't change your local IP, so it is not suitable for anonymity.
1212

13-
# Serverless with MitM-Domain-Fronting for Iran (Xray-core v25.2.21+)
13+
# Serverless with MitM-Domain-Fronting for Iran (Xray-core v25.9.5+)
1414

1515
Same as "Serverless for Iran" but use "DoH h2c + domain fronting" for DNS and MitM for these services that support domain fronting:
1616
* YouTube

Serverless-for-Iran/serverless_for_Iran.jsonc

Lines changed: 191 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -1,197 +1,271 @@
11
// Configs here can not contain "bypassing sanctions" contents (inappropriate on US GitHub)
22
// Please join the official Xray Iranian group https://t.me/projectXhttp to get the whole working configs
33

4-
// Serverless for Iran v4
5-
// Xray-core v25.2.21+
6-
7-
// Bypass censorship using TCP/TLS fragment and UDP noises.
8-
// It doesn't change your local IP, so it is not suitable for anonymity.
94

105
{
6+
"remarks": "Serverless-v5",
7+
8+
"version": {
9+
"min": "25.9.5"
10+
},
11+
1112
"log": {
1213
"loglevel": "warning", "dnsLog": false, "access": "none"
1314
},
1415

16+
"policy": {
17+
"levels": {
18+
"0": {
19+
"uplinkOnly": 0,
20+
"downlinkOnly": 0
21+
}
22+
}
23+
},
24+
1525
"dns":{
1626
"hosts": {
17-
"geosite:category-ads-all": ["10.10.34.36", "2001:4188:2:600:10:10:34:36"],
18-
"dns.cloudflare.com": "cloudflare.com"
27+
"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"
1930
},
2031
"servers": [
21-
"https://dns.cloudflare.com/dns-query",
22-
{"address": "localhost", "domains": ["geosite:private", "geosite:category-ir", "full:cloudflare.com"]}
32+
{
33+
"address": "fakedns",
34+
"domains": ["domain:ir", "geosite:private", "geosite:category-ir", "full:www.cloudflare.com"],
35+
"finalQuery": true
36+
},
37+
{
38+
"tag": "no-filter-dns",
39+
"address": "https://cloudflare-dns.com/dns-query",
40+
"timeoutMs": 5000,
41+
"finalQuery": true
42+
},
43+
{
44+
"address": "localhost",
45+
"domains": ["domain:ir", "geosite:private", "geosite:category-ir", "full:www.cloudflare.com"],
46+
"finalQuery": true
47+
}
2348
],
24-
"tag": "dns-query",
25-
"disableFallback": true
49+
"queryStrategy": "UseSystem",
50+
"useSystemHosts": true
2651
},
27-
52+
2853
"inbounds": [
2954
{
3055
"tag": "dns-in",
56+
"listen": "127.0.0.1",
3157
"port": 10853,
32-
"protocol": "dokodemo-door",
58+
"protocol": "tunnel",
3359
"settings": {
34-
"address": "1.1.1.1",
60+
"address": "one.one.one.one",
3561
"port": 53,
36-
"network": "tcp,udp"
37-
}
62+
"network": "tcp,udp"
63+
},
64+
"streamSettings": {
65+
"sockopt": {
66+
"tcpKeepAliveInterval": 1,
67+
"tcpKeepAliveIdle": 46
68+
}
69+
}
3870
},
3971
{
4072
"tag": "socks-in",
73+
"listen": "127.0.0.1",
4174
"port": 10808,
42-
"protocol": "socks",
75+
"protocol": "mixed",
4376
"sniffing": {
4477
"enabled": true,
45-
"destOverride": ["http", "tls"],
78+
"destOverride": ["fakedns"],
4679
"routeOnly": false
4780
},
48-
"settings": {"udp": true}
49-
}
81+
"settings": {
82+
"udp": true,
83+
"ip": "127.0.0.1"
84+
},
85+
"streamSettings": {
86+
"sockopt": {
87+
"tcpKeepAliveInterval": 1,
88+
"tcpKeepAliveIdle": 46
89+
}
90+
}
91+
}
5092
],
5193

52-
"outbounds": [
94+
"outbounds": [
5395
{
54-
"tag": "block",
55-
"protocol": "blackhole"
96+
"tag": "block-out",
97+
"protocol": "block"
5698
},
5799
{
58-
"tag": "direct",
59-
"protocol": "freedom",
60-
"settings": {"domainStrategy": "ForceIP"}
61-
},
100+
"tag": "direct-out",
101+
"protocol": "direct",
102+
"streamSettings": {
103+
"sockopt": {
104+
"domainStrategy": "ForceIP",
105+
"happyEyeballs": {
106+
"tryDelayMs": 100,
107+
"prioritizeIPv6": true,
108+
"interleave": 2,
109+
"maxConcurrentTry": 16
110+
}
111+
}
112+
}
113+
},
62114
{
63115
"tag": "dns-out",
64-
"protocol": "dns",
65-
"settings": {"nonIPQuery": "skip", "network": "tcp", "address": "1.1.1.1", "port": 53},
116+
"protocol": "dns",
117+
"settings": {"nonIPQuery": "skip", "network": "tcp", "address": "one.one.one.one", "port": 53},
66118
"streamSettings": {
67119
"sockopt": {
68-
"dialerProxy": "chain1-fragment"
120+
"dialerProxy": "full-fragment"
69121
}
70122
}
71123
},
72124
{
73-
"tag": "super-fragment",
74-
"protocol": "freedom",
125+
"tag": "skip-fragment",
126+
"protocol": "direct",
75127
"settings": {
76128
"fragment": {
77-
"packets": "tlshello",
78-
"length": "6",
79-
"interval": "0"
129+
"packets": "1-1",
130+
"length": "130",
131+
"interval": "260",
132+
"maxSplit": "4"
80133
}
81134
},
82135
"streamSettings": {
83136
"sockopt": {
84-
"dialerProxy": "chain1-fragment"
137+
"dialerProxy": "_chain-skip"
85138
}
86-
}
139+
}
87140
},
88141
{
89-
"tag": "chain1-fragment",
90-
"protocol": "freedom",
142+
"tag": "_chain-skip",
143+
"protocol": "direct",
91144
"settings": {
92145
"fragment": {
93-
"packets": "1-3",
94-
"length": "517",
95-
"interval": "1"
146+
"packets": "2-4",
147+
"length": "1",
148+
"interval": "2",
149+
"maxSplit": "130"
96150
}
97151
},
98152
"streamSettings": {
99153
"sockopt": {
100-
"dialerProxy": "chain2-fragment"
154+
"domainStrategy": "ForceIP",
155+
"happyEyeballs": {
156+
"tryDelayMs": 300,
157+
"prioritizeIPv6": true,
158+
"interleave": 2,
159+
"maxConcurrentTry": 16
160+
}
101161
}
102-
}
103-
},
162+
}
163+
},
104164
{
105-
"tag": "chain2-fragment",
106-
"protocol": "freedom",
165+
"tag": "full-fragment",
166+
"protocol": "direct",
107167
"settings": {
108-
"domainStrategy": "ForceIP",
109168
"fragment": {
110169
"packets": "1-1",
111170
"length": "1",
112-
"interval": "2"
171+
"interval": "2",
172+
"maxSplit": "517"
173+
}
174+
},
175+
"streamSettings": {
176+
"sockopt": {
177+
"domainStrategy": "ForceIP",
178+
"happyEyeballs": {
179+
"tryDelayMs": 300,
180+
"prioritizeIPv6": true,
181+
"interleave": 2,
182+
"maxConcurrentTry": 16
183+
}
113184
}
114185
}
115186
},
116187
{
117-
"tag": "udp-noisesv4",
118-
"protocol": "freedom",
188+
"tag": "udp-noises",
189+
"protocol": "direct",
119190
"settings": {
120-
"domainStrategy": "ForceIPv4",
191+
"targetStrategy": "ForceIP", // or "ForceIPv6v4" to prefer IPv6
121192
"noises": [
122-
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
123-
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
124-
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
125-
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
126-
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
127-
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
128-
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
129-
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
130-
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
131-
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
132-
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
133-
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"}
193+
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
194+
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
195+
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
196+
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
197+
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
198+
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
199+
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
200+
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
201+
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
202+
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
203+
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
204+
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
205+
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
206+
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
207+
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
208+
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
209+
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
210+
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
211+
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
212+
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
213+
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
214+
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
215+
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
216+
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}
134217
]
135-
}
136-
},
137-
{
138-
"tag": "udp-noisesv6",
139-
"protocol": "freedom",
140-
"settings": {
141-
"domainStrategy": "ForceIPv6",
142-
"noises": [
143-
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
144-
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
145-
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
146-
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
147-
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
148-
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
149-
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
150-
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
151-
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
152-
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
153-
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
154-
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"}
155-
]
156-
}
157-
}
218+
}
219+
}
158220
],
159221

160222
"routing": {
161223
"domainStrategy": "IPOnDemand",
162-
"rules": [
224+
"rules": [
225+
{"outboundTag": "block-out",
226+
"domain": ["geosite:category-ads-all"]
227+
},
163228
{"outboundTag": "dns-out",
164-
"inboundTag": ["dns-in"]
229+
"inboundTag": ["dns-in"]
165230
},
166231
{"outboundTag": "dns-out",
167-
"inboundTag": ["socks-in"], "port": 53
168-
},
169-
{"outboundTag": "chain1-fragment", // or "super-fragment"
170-
"inboundTag": ["dns-query"]
171-
},
172-
{"outboundTag": "block",
173-
"domain": ["geosite:category-ads-all"]
174-
},
175-
{"outboundTag": "block",
176-
"ip": ["10.10.34.0/24", "2001:4188:2:600:10:10:34:36", "2001:4188:2:600:10:10:34:35", "2001:4188:2:600:10:10:34:34"]
177-
},
178-
{"outboundTag": "direct",
179-
"domain": ["geosite:private", "geosite:category-ir"]
180-
},
181-
{"outboundTag": "direct",
182-
"ip": ["geoip:private", "geoip:ir"]
183-
},
184-
{"outboundTag": "udp-noisesv4",
185-
"network": "udp", "ip": ["0.0.0.0/0"], "port": 443
186-
},
187-
{"outboundTag": "udp-noisesv6",
188-
"network": "udp", "ip": ["::/0"], "port": 443
189-
},
190-
{"outboundTag": "direct",
191-
"network": "udp"
192-
},
193-
{"outboundTag": "chain1-fragment", // or "super-fragment"
194-
"network": "tcp"
232+
"inboundTag": ["socks-in"], "port": 53
233+
},
234+
{"outboundTag": "full-fragment", // or "skip-fragment"
235+
"inboundTag": ["no-filter-dns"]
236+
},
237+
{"outboundTag": "block-out",
238+
"ip": ["0.0.0.0", "::"]
239+
},
240+
{"outboundTag": "direct-out",
241+
"domain": ["domain:ir", "geosite:private", "geosite:category-ir"]
242+
},
243+
{"outboundTag": "direct-out",
244+
"ip": ["geoip:private", "geoip:ir"]
245+
},
246+
{"outboundTag": "udp-noises",
247+
"network": "udp", "protocol": ["quic"]
248+
},
249+
{"outboundTag": "udp-noises",
250+
"network": "udp", "port": "443,2053,2083,2087,2096,8443"
251+
},
252+
{"outboundTag": "direct-out",
253+
"network": "udp"
254+
},
255+
{"outboundTag": "full-fragment", // or "skip-fragment"
256+
"network": "tcp", "protocol": ["tls"]
257+
},
258+
{"outboundTag": "full-fragment", // or "skip-fragment"
259+
"network": "tcp", "port": "443,2053,2083,2087,2096,8443"
260+
},
261+
{"outboundTag": "full-fragment",
262+
"network": "tcp", "protocol": ["http"]
263+
},
264+
{"outboundTag": "full-fragment",
265+
"network": "tcp", "port": "80,8080,8880,2052,2082,2086,2095"
266+
},
267+
{"outboundTag": "full-fragment",
268+
"network": "tcp"
195269
}
196270
]
197271
}

0 commit comments

Comments
 (0)