singbox.json 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. {
  2. "log": {
  3. "level": "debug",
  4. "timestamp": true
  5. },
  6. "dns": {
  7. "servers": [
  8. {
  9. "tag": "remote",
  10. "address": "https://8.8.8.8/dns-query",
  11. "detour": "select"
  12. },
  13. {
  14. "tag": "local",
  15. "address": "https://223.5.5.5/dns-query",
  16. "detour": "direct"
  17. },
  18. {
  19. "tag": "block",
  20. "address": "rcode://success"
  21. },
  22. {
  23. "tag": "fakeip",
  24. "address": "fakeip"
  25. }
  26. ],
  27. "rules": [
  28. {
  29. "outbound": ["any"],
  30. "server": "local"
  31. },
  32. {
  33. "clash_mode": "Global",
  34. "server": "remote"
  35. },
  36. {
  37. "clash_mode": "Direct",
  38. "server": "local"
  39. },
  40. {
  41. "rule_set": "geosite-geolocation-cn",
  42. "server": "local"
  43. },
  44. {
  45. "type": "logical",
  46. "mode": "and",
  47. "rules": [
  48. {
  49. "rule_set": "geosite-geolocation-!cn",
  50. "invert": true
  51. },
  52. {
  53. "rule_set": "geoip-cn"
  54. }
  55. ],
  56. "server": "local"
  57. },
  58. {
  59. "rule_set": "geosite-geolocation-!cn",
  60. "query_type":["A","AAAA"],
  61. "server": "fakeip",
  62. "rewrite_ttl": 1
  63. }
  64. ],
  65. "fakeip": {
  66. "enabled": true,
  67. "inet4_range": "198.18.0.0/15",
  68. "inet6_range": "fc00::/18"
  69. },
  70. "strategy": "prefer_ipv4",
  71. "independent_cache": true,
  72. "reverse_mapping": true
  73. },
  74. "inbounds": [
  75. {
  76. "type": "mixed",
  77. "tag": "mixed-in",
  78. "listen": "0.0.0.0",
  79. "listen_port": 10172,
  80. "tcp_fast_open":true,
  81. "sniff": false,
  82. "sniff_override_destination": false,
  83. "domain_strategy": "prefer_ipv4",
  84. "set_system_proxy": false
  85. },
  86. {
  87. "type": "socks",
  88. "tag": "socks-in",
  89. "listen": "0.0.0.0",
  90. "listen_port": 10173,
  91. "tcp_fast_open":true,
  92. "sniff": false,
  93. "sniff_override_destination": false,
  94. "domain_strategy": "prefer_ipv4"
  95. },
  96. {
  97. "type": "mixed",
  98. "tag": "mixed-in2",
  99. "listen": "0.0.0.0",
  100. "listen_port": 10174,
  101. "tcp_fast_open":true,
  102. "sniff": false,
  103. "sniff_override_destination": false,
  104. "domain_strategy": "prefer_ipv4",
  105. "set_system_proxy": false
  106. },
  107. {
  108. "type": "mixed",
  109. "tag": "mixed-in3",
  110. "listen": "0.0.0.0",
  111. "listen_port": 10175,
  112. "tcp_fast_open":true,
  113. "sniff": false,
  114. "sniff_override_destination": false,
  115. "domain_strategy": "prefer_ipv4",
  116. "set_system_proxy": false
  117. }
  118. ],
  119. "outbounds": [
  120. {
  121. "type": "selector",
  122. "tag": "select",
  123. "outbounds": [
  124. "urltest"
  125. ],
  126. "default": "urltest"
  127. },
  128. {
  129. "type": "urltest",
  130. "tag": "urltest",
  131. "interval": "30m",
  132. "idle_timeout": "60m",
  133. "interrupt_exist_connections": false,
  134. "outbounds": null
  135. },
  136. {
  137. "type": "direct",
  138. "tag": "direct"
  139. },
  140. {
  141. "type": "block",
  142. "tag": "block"
  143. },
  144. {
  145. "type": "dns",
  146. "tag": "dns-out"
  147. }
  148. ],
  149. "route": {
  150. "rules": [
  151. {
  152. "type": "logical",
  153. "mode": "or",
  154. "rules": [
  155. {
  156. "protocol": "dns"
  157. },
  158. {
  159. "port": 53
  160. }
  161. ],
  162. "outbound": "dns-out"
  163. },
  164. {
  165. "ip_is_private": true,
  166. "outbound": "direct"
  167. },
  168. {
  169. "inbound":[
  170. "mixed-in2"
  171. ],
  172. "outbound":"select2"
  173. },
  174. {
  175. "inbound":[
  176. "mixed-in3"
  177. ],
  178. "outbound":"select3"
  179. },
  180. {
  181. "clash_mode": "Direct",
  182. "outbound": "direct"
  183. },
  184. {
  185. "clash_mode": "Global",
  186. "outbound": "select"
  187. },
  188. {
  189. "type": "logical",
  190. "mode": "or",
  191. "rules": [
  192. {
  193. "port": 853
  194. },
  195. {
  196. "network": "udp",
  197. "port": 443
  198. },
  199. {
  200. "protocol": "stun"
  201. }
  202. ],
  203. "outbound": "block"
  204. },
  205. {
  206. "rule_set": [
  207. "geoip-cn",
  208. "geosite-geolocation-cn"
  209. ],
  210. "outbound": "direct"
  211. }
  212. ],
  213. "rule_set": [
  214. {
  215. "type": "remote",
  216. "tag": "geoip-cn",
  217. "format": "binary",
  218. "url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs",
  219. "download_detour": "select"
  220. },
  221. {
  222. "type": "remote",
  223. "tag": "geosite-geolocation-cn",
  224. "format": "binary",
  225. "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-cn.srs",
  226. "download_detour": "select"
  227. },
  228. {
  229. "type": "remote",
  230. "tag": "geosite-geolocation-!cn",
  231. "format": "binary",
  232. "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-!cn.srs",
  233. "download_detour": "select"
  234. }
  235. ],
  236. "auto_detect_interface": false
  237. },
  238. "experimental": {
  239. "cache_file": {
  240. "enabled": true,
  241. "store_rdrc": true
  242. },
  243. "clash_api": {
  244. "external_controller": "0.0.0.0:19090",
  245. "external_ui": "ui",
  246. "external_ui_download_url": "https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip",
  247. "external_ui_download_detour": "select",
  248. "default_mode": "Rule"
  249. }
  250. }
  251. }