serverless_with_mitm_for_Iran.jsonc 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. // Configs here can not contain "bypassing sanctions" contents (inappropriate on US GitHub)
  2. // Please join the official Xray Iranian group https://t.me/projectXhttp to get the whole working configs
  3. // Serverless with MitM-Domain-Fronting for Iran v4
  4. // Xray-core v25.2.21+
  5. // Requires a self-signed-certificate: You can create it using "./xray tls cert -ca -file=mycert" command.
  6. // Also, the certificate must be imported into "Trusted-Root-Certification-Authorities" of system/browser.
  7. {
  8. "log": {
  9. "loglevel": "warning", "dnsLog": false, "access": "none"
  10. },
  11. "dns":{
  12. "hosts": {
  13. "geosite:category-ads-all": ["10.10.34.36", "2001:4188:2:600:10:10:34:36"]
  14. },
  15. "servers": [
  16. "h2c://1.1.1.1/dns-query",
  17. {"address": "localhost", "domains": ["geosite:private", "geosite:category-ir"]}
  18. ],
  19. "tag": "dns-query",
  20. "disableFallback": true
  21. },
  22. "inbounds": [
  23. {
  24. "tag": "dns-in",
  25. "port": 10853,
  26. "protocol": "dokodemo-door",
  27. "settings": {
  28. "address": "1.1.1.1",
  29. "port": 53,
  30. "network": "tcp,udp"
  31. }
  32. },
  33. {
  34. "tag": "socks-in",
  35. "port": 10808,
  36. "protocol": "socks",
  37. "sniffing": {
  38. "enabled": true,
  39. "destOverride": ["http", "tls"],
  40. "routeOnly": false
  41. },
  42. "settings": {"udp": true}
  43. },
  44. {
  45. "port": 4431,
  46. "tag": "tls-decrypt-h11",
  47. "protocol": "dokodemo-door",
  48. "settings": {
  49. "network": "tcp",
  50. "port": 443,
  51. "followRedirect": true
  52. },
  53. "streamSettings": {
  54. "security": "tls",
  55. "tlsSettings": {
  56. "alpn": ["http/1.1"],
  57. "certificates": [
  58. {
  59. "usage": "issue",
  60. "certificateFile": "mycert.crt", // certificate path
  61. "keyFile": "mycert.key" // private-key path
  62. }
  63. ]
  64. }
  65. }
  66. },
  67. {
  68. "port": 4432,
  69. "tag": "tls-decrypt-h211",
  70. "protocol": "dokodemo-door",
  71. "settings": {
  72. "network": "tcp",
  73. "port": 443,
  74. "followRedirect": true
  75. },
  76. "streamSettings": {
  77. "security": "tls",
  78. "tlsSettings": {
  79. "alpn": ["h2","http/1.1"],
  80. "certificates": [
  81. {
  82. "usage": "issue",
  83. "certificateFile": "mycert.crt", // certificate path
  84. "keyFile": "mycert.key" // private-key path
  85. }
  86. ]
  87. }
  88. }
  89. }
  90. ],
  91. "outbounds": [
  92. {
  93. "tag": "block",
  94. "protocol": "blackhole"
  95. },
  96. {
  97. "tag": "direct",
  98. "protocol": "freedom",
  99. "settings": {"domainStrategy": "ForceIP"}
  100. },
  101. {
  102. "tag": "redirect-out-h11",
  103. "protocol": "freedom",
  104. "settings": {
  105. "redirect": "[::1]:4431"
  106. }
  107. },
  108. {
  109. "tag": "redirect-out-h211",
  110. "protocol": "freedom",
  111. "settings": {
  112. "redirect": "[::1]:4432"
  113. }
  114. },
  115. {
  116. "tag": "tls-repack-dns",
  117. "protocol": "freedom",
  118. "settings": {"domainStrategy": "ForceIP"},
  119. "streamSettings": {
  120. "security": "tls",
  121. "tlsSettings": {
  122. "serverName": "www.microsoft.com",
  123. "verifyPeerCertInNames": ["fromMitM", "www.microsoft.com"],
  124. "alpn": ["fromMitM"],
  125. "fingerprint": "chrome"
  126. }
  127. }
  128. },
  129. {
  130. "tag": "tls-repack-google",
  131. "protocol": "freedom",
  132. "settings": {"domainStrategy": "ForceIP"},
  133. "streamSettings": {
  134. "security": "tls",
  135. "tlsSettings": {
  136. "serverName": "www.google.com",
  137. "verifyPeerCertInNames": ["fromMitM", "www.google.com", "dns.google", "www.googlevideo.com", "www.youtube.com"],
  138. "alpn": ["fromMitM"],
  139. "fingerprint": "chrome"
  140. }
  141. }
  142. },
  143. {
  144. "tag": "tls-repack-meta",
  145. "protocol": "freedom",
  146. "settings": {"domainStrategy": "ForceIP"},
  147. "streamSettings": {
  148. "security": "tls",
  149. "tlsSettings": {
  150. "serverName": "www.whatsapp.com",
  151. "verifyPeerCertInNames": ["fromMitM", "www.whatsapp.com", "www.facebook.com", "www.ar.meta.com", "www.fb.com", "www.whatsapp.net", "www.atlassolutions.com", "www.secure.facebook.com", "www.extern.facebook.com", "www.internet.org", "www.oculus.com", "www.wit.ai", "www.facebook-dns.com", "www.instagram.com", "www.meta.com", "www.external-disputes.meta.com", "www.fbe2e.com", "www.cloud.x2p.facebook.net", "www.secure.latest.facebook.com"],
  152. "alpn": ["fromMitM"],
  153. "fingerprint": "chrome"
  154. }
  155. }
  156. },
  157. {
  158. "tag": "tls-repack-fastly",
  159. "protocol": "freedom",
  160. "settings": {"domainStrategy": "ForceIP"},
  161. "streamSettings": {
  162. "security": "tls",
  163. "tlsSettings": {
  164. "serverName": "www.fastly.com",
  165. "verifyPeerCertInNames": ["fromMitM", "www.fastly.com", "www.reddit.com", "x.com"],
  166. "alpn": ["fromMitM"],
  167. "fingerprint": "chrome"
  168. }
  169. }
  170. },
  171. {
  172. "tag": "dns-out",
  173. "protocol": "dns",
  174. "settings": {"nonIPQuery": "skip", "network": "tcp", "address": "1.1.1.1", "port": 53},
  175. "streamSettings": {
  176. "sockopt": {
  177. "dialerProxy": "chain1-fragment"
  178. }
  179. }
  180. },
  181. {
  182. "tag": "super-fragment",
  183. "protocol": "freedom",
  184. "settings": {
  185. "fragment": {
  186. "packets": "tlshello",
  187. "length": "6",
  188. "interval": "0"
  189. }
  190. },
  191. "streamSettings": {
  192. "sockopt": {
  193. "dialerProxy": "chain1-fragment"
  194. }
  195. }
  196. },
  197. {
  198. "tag": "chain1-fragment",
  199. "protocol": "freedom",
  200. "settings": {
  201. "fragment": {
  202. "packets": "1-3",
  203. "length": "517",
  204. "interval": "1"
  205. }
  206. },
  207. "streamSettings": {
  208. "sockopt": {
  209. "dialerProxy": "chain2-fragment"
  210. }
  211. }
  212. },
  213. {
  214. "tag": "chain2-fragment",
  215. "protocol": "freedom",
  216. "settings": {
  217. "domainStrategy": "ForceIP",
  218. "fragment": {
  219. "packets": "1-1",
  220. "length": "1",
  221. "interval": "2"
  222. }
  223. }
  224. },
  225. {
  226. "tag": "udp-noisesv4",
  227. "protocol": "freedom",
  228. "settings": {
  229. "domainStrategy": "ForceIPv4",
  230. "noises": [
  231. {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
  232. {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
  233. {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
  234. {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
  235. {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
  236. {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
  237. {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
  238. {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
  239. {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
  240. {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
  241. {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
  242. {"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"}
  243. ]
  244. }
  245. },
  246. {
  247. "tag": "udp-noisesv6",
  248. "protocol": "freedom",
  249. "settings": {
  250. "domainStrategy": "ForceIPv6",
  251. "noises": [
  252. {"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
  253. {"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
  254. {"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
  255. {"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
  256. {"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
  257. {"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
  258. {"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
  259. {"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
  260. {"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
  261. {"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
  262. {"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
  263. {"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"}
  264. ]
  265. }
  266. }
  267. ],
  268. "routing": {
  269. "domainStrategy": "IPOnDemand",
  270. "rules": [
  271. {"outboundTag": "dns-out",
  272. "inboundTag": ["dns-in"]
  273. },
  274. {"outboundTag": "dns-out",
  275. "inboundTag": ["socks-in"], "port": 53
  276. },
  277. {"outboundTag": "tls-repack-dns",
  278. "inboundTag": ["dns-query"]
  279. },
  280. {"outboundTag": "block",
  281. "domain": ["geosite:category-ads-all"]
  282. },
  283. {"outboundTag": "block",
  284. "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"]
  285. },
  286. {"outboundTag": "direct",
  287. "domain": ["geosite:private", "geosite:category-ir"]
  288. },
  289. {"outboundTag": "direct",
  290. "ip": ["geoip:private", "geoip:ir"]
  291. },
  292. {"outboundTag": "chain1-fragment", // or "super-fragment"
  293. "inboundTag": ["socks-in"],
  294. "network": "tcp",
  295. "ip": ["geoip:cloudflare", "geoip:cloudfront"]
  296. },
  297. {
  298. "outboundTag": "redirect-out-h11",
  299. "inboundTag": ["socks-in"],
  300. "network": "tcp",
  301. "protocol": ["tls"],
  302. "port": 443,
  303. "domain": ["domain:googlevideo.com"]
  304. },
  305. {
  306. "outboundTag": "redirect-out-h211",
  307. "inboundTag": ["socks-in"],
  308. "network": "tcp",
  309. "protocol": ["tls"],
  310. "port": 443,
  311. "domain": ["geosite:youtube", "geosite:x", "geosite:reddit", "geosite:meta"]
  312. },
  313. {"outboundTag": "tls-repack-google",
  314. "domain": ["geosite:youtube", "domain:googlevideo.com"],
  315. "inboundTag": ["tls-decrypt-h11", "tls-decrypt-h211"]
  316. },
  317. {"outboundTag": "tls-repack-meta",
  318. "domain": ["geosite:meta"],
  319. "inboundTag": ["tls-decrypt-h11", "tls-decrypt-h211"]
  320. },
  321. {"outboundTag": "tls-repack-fastly",
  322. "domain": ["geosite:x", "geosite:reddit"],
  323. "inboundTag": ["tls-decrypt-h11", "tls-decrypt-h211"]
  324. },
  325. {"outboundTag": "udp-noisesv4",
  326. "network": "udp", "ip": ["0.0.0.0/0"], "port": 443
  327. },
  328. {"outboundTag": "udp-noisesv6",
  329. "network": "udp", "ip": ["::/0"], "port": 443
  330. },
  331. {"outboundTag": "direct",
  332. "network": "udp"
  333. },
  334. {"outboundTag": "chain1-fragment", // or "super-fragment"
  335. "network": "tcp"
  336. }
  337. ]
  338. }
  339. }