serverless_for_Iran.jsonc 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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 for Iran v1
  4. // Xray-core v25.2.21+
  5. {
  6. "log": {
  7. "loglevel": "warning", "dnsLog": false, "access": "none"
  8. },
  9. "dns":{
  10. "hosts": {
  11. "geosite:category-ads-all": ["10.10.34.36", "2001:4188:2:600:10:10:34:36"],
  12. "dns.cloudflare.com": "cloudflare.com"
  13. },
  14. "servers": [
  15. "https://dns.cloudflare.com/dns-query",
  16. {"address": "localhost", "domains": ["geosite:private", "geosite:category-ir", "full:cloudflare.com"]}
  17. ],
  18. "tag": "dns-query",
  19. "disableFallback": true
  20. },
  21. "inbounds": [
  22. {
  23. "tag": "dns-in",
  24. "port": 10853,
  25. "protocol": "dokodemo-door",
  26. "settings": {
  27. "address": "1.1.1.1",
  28. "port": 53,
  29. "network": "tcp,udp"
  30. }
  31. },
  32. {
  33. "tag": "socks-in",
  34. "port": 10808,
  35. "protocol": "socks",
  36. "sniffing": {
  37. "enabled": true,
  38. "destOverride": ["http", "tls", "quic"],
  39. "routeOnly": false
  40. },
  41. "settings": {"udp": true}
  42. }
  43. ],
  44. "outbounds": [
  45. {
  46. "tag": "block",
  47. "protocol": "blackhole"
  48. },
  49. {
  50. "tag": "direct",
  51. "protocol": "freedom",
  52. "settings": {"domainStrategy": "ForceIP"}
  53. },
  54. {
  55. "tag": "dns-out",
  56. "protocol": "dns",
  57. "settings": {"nonIPQuery": "skip", "network": "tcp", "address": "1.1.1.1", "port": 53},
  58. "streamSettings": {
  59. "sockopt": {
  60. "dialerProxy": "chain1-fragment"
  61. }
  62. }
  63. },
  64. {
  65. "tag": "super-fragment",
  66. "protocol": "freedom",
  67. "settings": {
  68. "fragment": {
  69. "packets": "tlshello",
  70. "length": "6",
  71. "interval": "0"
  72. }
  73. },
  74. "streamSettings": {
  75. "sockopt": {
  76. "dialerProxy": "chain1-fragment"
  77. }
  78. }
  79. },
  80. {
  81. "tag": "chain1-fragment",
  82. "protocol": "freedom",
  83. "settings": {
  84. "fragment": {
  85. "packets": "1-3",
  86. "length": "517",
  87. "interval": "1"
  88. }
  89. },
  90. "streamSettings": {
  91. "sockopt": {
  92. "dialerProxy": "chain2-fragment"
  93. }
  94. }
  95. },
  96. {
  97. "tag": "chain2-fragment",
  98. "protocol": "freedom",
  99. "settings": {
  100. "domainStrategy": "ForceIP",
  101. "fragment": {
  102. "packets": "1-1",
  103. "length": "1",
  104. "interval": "2"
  105. }
  106. },
  107. "streamSettings": {
  108. "sockopt": {
  109. "tcpNoDelay": true
  110. }
  111. }
  112. },
  113. {
  114. "tag": "udp-noises",
  115. "protocol": "freedom",
  116. "settings": {
  117. "domainStrategy": "ForceIP",
  118. "noises": [
  119. {"type": "rand", "packet": "257-507", "delay": "1"}, {"type": "rand", "packet": "257-507", "delay": "1"},
  120. {"type": "rand", "packet": "257-507", "delay": "1"}, {"type": "rand", "packet": "257-507", "delay": "1"},
  121. {"type": "rand", "packet": "257-507", "delay": "1"}, {"type": "rand", "packet": "257-507", "delay": "1"},
  122. {"type": "rand", "packet": "257-507", "delay": "1"}, {"type": "rand", "packet": "257-507", "delay": "1"},
  123. {"type": "rand", "packet": "257-507", "delay": "1"}, {"type": "rand", "packet": "257-507", "delay": "1"},
  124. {"type": "rand", "packet": "257-507", "delay": "1"}, {"type": "rand", "packet": "257-507", "delay": "1"},
  125. {"type": "rand", "packet": "257-507", "delay": "1"}, {"type": "rand", "packet": "257-507", "delay": "1"},
  126. {"type": "rand", "packet": "257-507", "delay": "1"}, {"type": "rand", "packet": "257-507", "delay": "1"},
  127. {"type": "rand", "packet": "257-507", "delay": "1"}, {"type": "rand", "packet": "257-507", "delay": "1"},
  128. {"type": "rand", "packet": "257-507", "delay": "1"}, {"type": "rand", "packet": "257-507", "delay": "1"},
  129. {"type": "rand", "packet": "257-507", "delay": "1"}, {"type": "rand", "packet": "257-507", "delay": "1"},
  130. {"type": "rand", "packet": "257-507", "delay": "1"}, {"type": "rand", "packet": "257-507", "delay": "1"},
  131. {"type": "rand", "packet": "257-507", "delay": "1"}, {"type": "rand", "packet": "257-507", "delay": "10"}
  132. ]
  133. }
  134. }
  135. ],
  136. "routing": {
  137. "domainStrategy": "IPOnDemand",
  138. "rules": [
  139. {"outboundTag": "dns-out",
  140. "inboundTag": ["dns-in"]
  141. },
  142. {"outboundTag": "dns-out",
  143. "inboundTag": ["socks-in"], "port": 53
  144. },
  145. {"outboundTag": "chain1-fragment", // or "super-fragment"
  146. "inboundTag": ["dns-query"]
  147. },
  148. {"outboundTag": "block",
  149. "domain": ["geosite:category-ads-all"]
  150. },
  151. {"outboundTag": "block",
  152. "ip": ["10.10.34.0/24", "2001:4188:2:600:10:10:34:36", "2001:4188:2:600:10:10:34:35"]
  153. },
  154. {"outboundTag": "direct",
  155. "domain": ["geosite:private", "geosite:category-ir"]
  156. },
  157. {"outboundTag": "direct",
  158. "ip": ["geoip:private", "geoip:ir"]
  159. },
  160. {"outboundTag": "udp-noises",
  161. "network": "udp"
  162. },
  163. {"outboundTag": "chain1-fragment", // or "super-fragment"
  164. "network": "tcp"
  165. }
  166. ]
  167. }
  168. }