Update Serverless-for-Iran (#238)

Persian explanation: https://github.com/patterniha/Serverless-for-Iran
This commit is contained in:
patterniha
2025-09-18 11:23:04 +02:00
committed by GitHub
parent c7e8d285a0
commit 97d7f1ee19
2 changed files with 198 additions and 124 deletions

View File

@@ -10,7 +10,7 @@ Bypass censorship using TCP/TLS fragment and UDP noises.
It doesn't change your local IP, so it is not suitable for anonymity. It doesn't change your local IP, so it is not suitable for anonymity.
# Serverless with MitM-Domain-Fronting for Iran (Xray-core v25.2.21+) # Serverless with MitM-Domain-Fronting for Iran (Xray-core v25.9.5+)
Same as "Serverless for Iran" but use "DoH h2c + domain fronting" for DNS and MitM for these services that support domain fronting: Same as "Serverless for Iran" but use "DoH h2c + domain fronting" for DNS and MitM for these services that support domain fronting:
* YouTube * YouTube

View File

@@ -1,197 +1,271 @@
// Configs here can not contain "bypassing sanctions" contents (inappropriate on US GitHub) // Configs here can not contain "bypassing sanctions" contents (inappropriate on US GitHub)
// Please join the official Xray Iranian group https://t.me/projectXhttp to get the whole working configs // Please join the official Xray Iranian group https://t.me/projectXhttp to get the whole working configs
// Serverless for Iran v4
// Xray-core v25.2.21+
// Bypass censorship using TCP/TLS fragment and UDP noises.
// It doesn't change your local IP, so it is not suitable for anonymity.
{ {
"remarks": "Serverless",
"version": {
"min": "25.9.5"
},
"log": { "log": {
"loglevel": "warning", "dnsLog": false, "access": "none" "loglevel": "warning", "dnsLog": false, "access": "none"
}, },
"policy": {
"levels": {
"0": {
"uplinkOnly": 0,
"downlinkOnly": 0
}
}
},
"dns":{ "dns":{
"hosts": { "hosts": {
"geosite:category-ads-all": ["10.10.34.36", "2001:4188:2:600:10:10:34:36"], "geosite:category-ads-all": "#3",
"dns.cloudflare.com": "cloudflare.com" "one.one.one.one": ["1.1.1.1", "1.0.0.1", "2606:4700:4700::1111", "2606:4700:4700::1001"],
"cloudflare-dns.com": "www.cloudflare.com"
}, },
"servers": [ "servers": [
"https://dns.cloudflare.com/dns-query", {
{"address": "localhost", "domains": ["geosite:private", "geosite:category-ir", "full:cloudflare.com"]} "address": "fakedns",
"domains": ["domain:ir", "geosite:private", "geosite:category-ir", "full:www.cloudflare.com"],
"finalQuery": true
},
{
"tag": "no-filter-dns",
"address": "https://cloudflare-dns.com/dns-query",
"timeoutMs": 5000,
"finalQuery": true
},
{
"address": "localhost",
"domains": ["domain:ir", "geosite:private", "geosite:category-ir", "full:www.cloudflare.com"],
"finalQuery": true
}
], ],
"tag": "dns-query", "queryStrategy": "UseSystem",
"disableFallback": true "useSystemHosts": true
}, },
"inbounds": [ "inbounds": [
{ {
"tag": "dns-in", "tag": "dns-in",
"listen": "127.0.0.1",
"port": 10853, "port": 10853,
"protocol": "dokodemo-door", "protocol": "tunnel",
"settings": { "settings": {
"address": "1.1.1.1", "address": "one.one.one.one",
"port": 53, "port": 53,
"network": "tcp,udp" "network": "tcp,udp"
} },
"streamSettings": {
"sockopt": {
"tcpKeepAliveInterval": 1,
"tcpKeepAliveIdle": 46
}
}
}, },
{ {
"tag": "socks-in", "tag": "socks-in",
"listen": "127.0.0.1",
"port": 10808, "port": 10808,
"protocol": "socks", "protocol": "mixed",
"sniffing": { "sniffing": {
"enabled": true, "enabled": true,
"destOverride": ["http", "tls"], "destOverride": ["fakedns"],
"routeOnly": false "routeOnly": false
}, },
"settings": {"udp": true} "settings": {
} "udp": true,
], "ip": "127.0.0.1"
},
"outbounds": [
{
"tag": "block",
"protocol": "blackhole"
},
{
"tag": "direct",
"protocol": "freedom",
"settings": {"domainStrategy": "ForceIP"}
},
{
"tag": "dns-out",
"protocol": "dns",
"settings": {"nonIPQuery": "skip", "network": "tcp", "address": "1.1.1.1", "port": 53},
"streamSettings": { "streamSettings": {
"sockopt": { "sockopt": {
"dialerProxy": "chain1-fragment" "tcpKeepAliveInterval": 1,
"tcpKeepAliveIdle": 46
}
}
}
],
"outbounds": [
{
"tag": "block-out",
"protocol": "block"
},
{
"tag": "direct-out",
"protocol": "direct",
"streamSettings": {
"sockopt": {
"domainStrategy": "ForceIP",
"happyEyeballs": {
"tryDelayMs": 100,
"prioritizeIPv6": true,
"interleave": 2,
"maxConcurrentTry": 16
}
} }
} }
}, },
{ {
"tag": "super-fragment", "tag": "dns-out",
"protocol": "freedom", "protocol": "dns",
"settings": { "settings": {"nonIPQuery": "skip", "network": "tcp", "address": "one.one.one.one", "port": 53},
"fragment": {
"packets": "tlshello",
"length": "6",
"interval": "0"
}
},
"streamSettings": { "streamSettings": {
"sockopt": { "sockopt": {
"dialerProxy": "chain1-fragment" "dialerProxy": "full-fragment"
} }
} }
}, },
{ {
"tag": "chain1-fragment", "tag": "skip-fragment",
"protocol": "freedom", "protocol": "direct",
"settings": { "settings": {
"fragment": { "fragment": {
"packets": "1-3", "packets": "1-1",
"length": "517", "length": "130",
"interval": "1" "interval": "190",
"maxSplit": "4"
} }
}, },
"streamSettings": { "streamSettings": {
"sockopt": { "sockopt": {
"dialerProxy": "chain2-fragment" "dialerProxy": "_chain-skip"
} }
} }
}, },
{ {
"tag": "chain2-fragment", "tag": "_chain-skip",
"protocol": "freedom", "protocol": "direct",
"settings": {
"fragment": {
"packets": "2-4",
"length": "1",
"interval": "1",
"maxSplit": "130"
}
},
"streamSettings": {
"sockopt": {
"domainStrategy": "ForceIP",
"happyEyeballs": {
"tryDelayMs": 300,
"prioritizeIPv6": true,
"interleave": 2,
"maxConcurrentTry": 16
}
}
}
},
{
"tag": "full-fragment",
"protocol": "direct",
"settings": { "settings": {
"domainStrategy": "ForceIP",
"fragment": { "fragment": {
"packets": "1-1", "packets": "1-1",
"length": "1", "length": "1",
"interval": "2" "interval": "1",
"maxSplit": "517"
}
},
"streamSettings": {
"sockopt": {
"domainStrategy": "ForceIP",
"happyEyeballs": {
"tryDelayMs": 300,
"prioritizeIPv6": true,
"interleave": 2,
"maxConcurrentTry": 16
}
} }
} }
}, },
{ {
"tag": "udp-noisesv4", "tag": "udp-noises",
"protocol": "freedom", "protocol": "direct",
"settings": { "settings": {
"domainStrategy": "ForceIPv4", "targetStrategy": "ForceIP", // or "ForceIPv6v4" to prefer IPv6
"noises": [ "noises": [
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"} {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}
] ]
} }
}, }
{
"tag": "udp-noisesv6",
"protocol": "freedom",
"settings": {
"domainStrategy": "ForceIPv6",
"noises": [
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"}
]
}
}
], ],
"routing": { "routing": {
"domainStrategy": "IPOnDemand", "domainStrategy": "IPOnDemand",
"rules": [ "rules": [
{"outboundTag": "dns-out", {"outboundTag": "block-out",
"inboundTag": ["dns-in"] "domain": ["geosite:category-ads-all"]
}, },
{"outboundTag": "dns-out", {"outboundTag": "dns-out",
"inboundTag": ["socks-in"], "port": 53 "inboundTag": ["dns-in"]
}, },
{"outboundTag": "chain1-fragment", // or "super-fragment" {"outboundTag": "dns-out",
"inboundTag": ["dns-query"] "inboundTag": ["socks-in"], "port": 53
}, },
{"outboundTag": "block", {"outboundTag": "full-fragment", // or "skip-fragment"
"domain": ["geosite:category-ads-all"] "inboundTag": ["no-filter-dns"]
}, },
{"outboundTag": "block", {"outboundTag": "block-out",
"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"] "ip": ["0.0.0.0", "::"]
},
{"outboundTag": "direct",
"domain": ["geosite:private", "geosite:category-ir"]
},
{"outboundTag": "direct",
"ip": ["geoip:private", "geoip:ir"]
},
{"outboundTag": "udp-noisesv4",
"network": "udp", "ip": ["0.0.0.0/0"], "port": 443
}, },
{"outboundTag": "udp-noisesv6", {"outboundTag": "direct-out",
"network": "udp", "ip": ["::/0"], "port": 443 "domain": ["domain:ir", "geosite:private", "geosite:category-ir"]
}, },
{"outboundTag": "direct", {"outboundTag": "direct-out",
"network": "udp" "ip": ["geoip:private", "geoip:ir"]
}, },
{"outboundTag": "chain1-fragment", // or "super-fragment" {"outboundTag": "udp-noises",
"network": "tcp" "network": "udp", "protocol": ["quic"]
},
{"outboundTag": "udp-noises",
"network": "udp", "port": "443,2053,2083,2087,2096,8443"
},
{"outboundTag": "direct-out",
"network": "udp"
},
{"outboundTag": "full-fragment", // or "skip-fragment"
"network": "tcp", "protocol": ["tls"]
},
{"outboundTag": "full-fragment", // or "skip-fragment"
"network": "tcp", "port": "443,2053,2083,2087,2096,8443"
},
{"outboundTag": "full-fragment",
"network": "tcp", "protocol": ["http"]
},
{"outboundTag": "full-fragment",
"network": "tcp", "port": "80,8080,8880,2052,2082,2086,2095"
},
{"outboundTag": "full-fragment",
"network": "tcp"
} }
] ]
} }