singbox.json 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. {
  2. "log": {
  3. "level": "info",
  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. "query_type": [
  34. "A",
  35. "AAAA"
  36. ],
  37. "server": "fakeip",
  38. "rewrite_ttl": 1
  39. },
  40. {
  41. "clash_mode": "Global",
  42. "server": "remote"
  43. },
  44. {
  45. "clash_mode": "Direct",
  46. "server": "local"
  47. },
  48. {
  49. "rule_set": "geosite-geolocation-cn",
  50. "server": "local"
  51. },
  52. {
  53. "clash_mode": "Default",
  54. "server": "remote"
  55. },
  56. {
  57. "type": "logical",
  58. "mode": "and",
  59. "rules": [
  60. {
  61. "rule_set": "geosite-geolocation-!cn",
  62. "invert": true
  63. },
  64. {
  65. "rule_set": "geoip-cn"
  66. }
  67. ],
  68. "server": "local"
  69. }
  70. ],
  71. "fakeip": {
  72. "enabled": true,
  73. "inet4_range": "198.18.0.0/15",
  74. "inet6_range": "fc00::/18"
  75. },
  76. "strategy": "prefer_ipv4",
  77. "independent_cache": true
  78. },
  79. "inbounds": [
  80. {
  81. "type": "socks",
  82. "tag": "socks-in",
  83. "listen": "0.0.0.0",
  84. "listen_port": 10173,
  85. "tcp_fast_open":true,
  86. "sniff": false,
  87. "sniff_override_destination": false,
  88. "domain_strategy": "prefer_ipv4"
  89. },
  90. {
  91. "type": "mixed",
  92. "tag": "mixed-in",
  93. "listen": "0.0.0.0",
  94. "listen_port": 10172,
  95. "tcp_fast_open":true,
  96. "sniff": false,
  97. "sniff_override_destination": false,
  98. "domain_strategy": "prefer_ipv4",
  99. "set_system_proxy": false
  100. }
  101. ],
  102. "outbounds": [
  103. {
  104. "type": "selector",
  105. "tag": "select",
  106. "outbounds": [
  107. "urltest"
  108. ],
  109. "default": "urltest"
  110. },
  111. {
  112. "type": "urltest",
  113. "tag": "urltest",
  114. "interval": "15m",
  115. "outbounds": null
  116. },
  117. {
  118. "type": "direct",
  119. "tag": "direct"
  120. },
  121. {
  122. "type": "block",
  123. "tag": "block"
  124. },
  125. {
  126. "type": "dns",
  127. "tag": "dns-out"
  128. }
  129. ],
  130. "route": {
  131. "rules": [
  132. {
  133. "type": "logical",
  134. "mode": "or",
  135. "rules": [
  136. {
  137. "protocol": "dns"
  138. },
  139. {
  140. "port": 53
  141. }
  142. ],
  143. "outbound": "dns-out"
  144. },
  145. {
  146. "ip_is_private": true,
  147. "outbound": "direct"
  148. },
  149. {
  150. "clash_mode": "Direct",
  151. "outbound": "direct"
  152. },
  153. {
  154. "clash_mode": "Global",
  155. "outbound": "select"
  156. },
  157. {
  158. "type": "logical",
  159. "mode": "or",
  160. "rules": [
  161. {
  162. "port": 853
  163. },
  164. {
  165. "network": "udp",
  166. "port": 443
  167. },
  168. {
  169. "protocol": "stun"
  170. }
  171. ],
  172. "outbound": "block"
  173. },
  174. {
  175. "rule_set": [
  176. "geoip-cn",
  177. "geosite-geolocation-cn"
  178. ],
  179. "outbound": "direct"
  180. }
  181. ],
  182. "rule_set": [
  183. {
  184. "type": "remote",
  185. "tag": "geoip-cn",
  186. "format": "binary",
  187. "url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs",
  188. "download_detour": "select"
  189. },
  190. {
  191. "type": "remote",
  192. "tag": "geosite-geolocation-cn",
  193. "format": "binary",
  194. "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-cn.srs",
  195. "download_detour": "select"
  196. },
  197. {
  198. "type": "remote",
  199. "tag": "geosite-geolocation-!cn",
  200. "format": "binary",
  201. "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-!cn.srs",
  202. "download_detour": "select"
  203. }
  204. ],
  205. "auto_detect_interface": false
  206. },
  207. "experimental": {
  208. "cache_file": {
  209. "enabled": true,
  210. "store_rdrc": true
  211. },
  212. "clash_api": {
  213. "external_controller": "0.0.0.0:19090",
  214. "external_ui": "ui",
  215. "external_ui_download_url": "https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip",
  216. "external_ui_download_detour": "select",
  217. "default_mode": "rule"
  218. }
  219. }
  220. }