example.yaml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. # HTTP 代理端口
  2. port: 7890
  3. # SOCKS5 代理端口
  4. socks-port: 7891
  5. # Linux 和 macOS 的 redir 代理端口
  6. redir-port: 7892
  7. mixed-port: 7893
  8. # 允许局域网的连接
  9. allow-lan: true
  10. # 规则模式:Rule(规则) / Global(全局代理)/ Direct(全局直连)
  11. # mode: rule
  12. mode: Rule
  13. # 设置日志输出级别 (默认级别:silent,即不输出任何内容,以避免因日志内容过大而导致程序内存溢出)。
  14. # 5 个级别:silent / info / warning / error / debug。级别越高日志输出量越大,越倾向于调试,若需要请自行开启。
  15. log-level: debug
  16. # Clash 的 RESTful API
  17. external-controller: "127.0.0.1:9090"
  18. # RESTful API 的口令
  19. secret: ""
  20. # 您可以将静态网页资源(如 clash-dashboard)放置在一个目录中,clash 将会服务于 `RESTful API/ui`
  21. # 参数应填写配置目录的相对路径或绝对路径。
  22. # external-ui: folder
  23. # DNS 设置
  24. dns:
  25. nameserver:
  26. - 114.114.114.114
  27. - 119.29.29.29
  28. - https://doh.pub/dns-query
  29. - https://dns.alidns.com/dns-query
  30. fallback:
  31. - https://dns.cloudflare.com/dns-query
  32. - "[2001:da8::666]:53"
  33. - https://public.dns.iij.jp/dns-query
  34. - https://jp.tiar.app/dns-query
  35. - https://jp.tiarap.org/dns-query
  36. - tls://dot.tiar.app
  37. enable: true
  38. ipv6: false
  39. # enhanced-mode: redir-host
  40. enhanced-mode: fake-ip
  41. fake-ip-range: 198.18.0.1/16
  42. listen: 0.0.0.0:53
  43. fake-ip-filter:
  44. - "*.lan"
  45. default-nameserver:
  46. - 114.114.114.114
  47. - 119.29.29.29
  48. - "[2001:da8::666]:53"
  49. tun:
  50. enable: false
  51. stack: system
  52. # stack: gvisor
  53. dns-hijack:
  54. - 198.18.0.2:53 # when `fake-ip-range` is 198.18.0.1/16, should hijack 198.18.0.2:53
  55. auto-route: true # auto set global route for Windows
  56. # It is recommended to use `interface-name`
  57. auto-detect-interface: true # auto detect interface, conflict with `interface-name`
  58. # 服务器节点订阅
  59. # proxy-providers:
  60. # sspool:
  61. # type: http
  62. # url: "xxx"
  63. # interval: 3600
  64. # path: ./proxy/sspool.yaml
  65. # health-check:
  66. # enable: true
  67. # interval: 600
  68. # url: http://www.gstatic.com/generate_204
  69. # proxies:
  70. # - name: "proxie"
  71. # type: vmess
  72. # server: xxx
  73. # port: 8080
  74. # uuid: xxx
  75. # alterId: 1
  76. # cipher: auto
  77. # udp: true
  78. # tls: false
  79. # network: ws
  80. # ws-opts:
  81. # path: /y831
  82. proxy-groups:
  83. - name: proxy
  84. type: select
  85. proxies:
  86. - REJECT
  87. - DIRECT
  88. rule-providers:
  89. # name: # Provider 名称
  90. # type: http # http 或 file
  91. # behavior: classical # 或 ipcidr、domain
  92. # path: # 文件路径
  93. # url: # 只有当类型为 HTTP 时才可用,您不需要在本地空间中创建新文件。
  94. # interval: # 自动更新间隔,仅在类型为 HTTP 时可用
  95. # reject:
  96. # type: http
  97. # behavior: domain
  98. # url: "https://ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/reject.txt"
  99. # path: ./ruleset/reject.yaml
  100. # interval: 86400
  101. # icloud:
  102. # type: http
  103. # behavior: domain
  104. # url: "https://ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/icloud.txt"
  105. # path: ./ruleset/icloud.yaml
  106. # interval: 86400
  107. # apple:
  108. # type: http
  109. # behavior: domain
  110. # url: "https://ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/apple.txt"
  111. # path: ./ruleset/apple.yaml
  112. # interval: 86400
  113. # google:
  114. # type: http
  115. # behavior: domain
  116. # url: "https://ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/google.txt"
  117. # path: ./ruleset/google.yaml
  118. # interval: 86400
  119. # direct:
  120. # type: http
  121. # behavior: domain
  122. # url: "https://ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/direct.txt"
  123. # path: ./ruleset/direct.yaml
  124. # interval: 86400
  125. # private:
  126. # type: http
  127. # behavior: domain
  128. # url: "https://ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/private.txt"
  129. # path: ./ruleset/private.yaml
  130. # interval: 86400
  131. # gfw:
  132. # type: http
  133. # behavior: domain
  134. # url: "https://ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/gfw.txt"
  135. # path: ./ruleset/gfw.yaml
  136. # interval: 86400
  137. # greatfire:
  138. # type: http
  139. # behavior: domain
  140. # url: "https://ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/greatfire.txt"
  141. # path: ./ruleset/greatfire.yaml
  142. # interval: 86400
  143. # lancidr:
  144. # type: http
  145. # behavior: ipcidr
  146. # url: "https://ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/lancidr.txt"
  147. # path: ./ruleset/lancidr.yaml
  148. # interval: 86400
  149. # china:
  150. # type: http
  151. # behavior: classical
  152. # url: "https://ghproxy.com/https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/RuleSet/China.yaml"
  153. # path: ./ruleset/china.yaml
  154. # interval: 86400
  155. # streamingcn:
  156. # type: http
  157. # behavior: classical
  158. # url: "https://ghproxy.com/https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/StreamingCN.yaml"
  159. # path: ./ruleset/streamingcn.yaml
  160. # interval: 86400
  161. # streaming:
  162. # type: http
  163. # behavior: classical
  164. # url: "https://ghproxy.com/https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Streaming.yaml"
  165. # path: ./ruleset/streaming.yaml
  166. # interval: 86400
  167. # telegram:
  168. # type: http
  169. # behavior: classical
  170. # url: "https://ghproxy.com/https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/RuleSet/Extra/Telegram/Telegram.yaml"
  171. # path: ./ruleset/telegram.yaml
  172. # interval: 86400
  173. # privacy:
  174. # type: http
  175. # behavior: classical
  176. # url: "https://ghproxy.com/https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/RuleSet/Guard/Privacy.yaml"
  177. # path: ./ruleset/hijacking.yaml
  178. # interval: 86400
  179. # hijacking:
  180. # type: http
  181. # behavior: classical
  182. # url: "https://ghproxy.com/https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/RuleSet/Guard/Hijacking.yaml"
  183. # path: ./ruleset/hijacking.yaml
  184. # interval: 86400
  185. # 规则
  186. # rules:
  187. # Unbreak
  188. # - PROCESS-NAME,China,DIRECT
  189. # - PROCESS-NAME,google,DIRECT
  190. # - RULE-SET,"🎯 全球直连",DIRECT
  191. # - RULE-SET,China,DIRECT
  192. # - RULE-SET,google,DIRECT
  193. # - MATCH,MATCH
  194. # - GEOIP,CN,DIRECT
  195. rules:
  196. # - DOMAIN,pub.dev,🌎 国外网站
  197. # - DOMAIN,translate.googleapis.com,🌎 国外网站
  198. # # https://github.com/Dreamacro/clash/issues/1663#issuecomment-1075815348
  199. # - DOMAIN-SUFFIX,msftconnecttest.com,🌎 国外网站
  200. # - RULE-SET,private,DIRECT
  201. # - RULE-SET,lancidr,DIRECT,no-resolve
  202. # - RULE-SET,applications,DIRECT
  203. # - RULE-SET,reject,🛑 广告拦截
  204. # - RULE-SET,privacy,🛑 隐私保护
  205. # - RULE-SET,hijacking,🛑 网络劫持
  206. # - RULE-SET,icloud,🍎 苹果服务
  207. # - RULE-SET,apple,🍎 苹果服务
  208. # - RULE-SET,china,🌏 国内网站
  209. # - RULE-SET,streamingcn,🌏 国内网站
  210. # - GEOIP,CN,🌏 国内网站
  211. # - RULE-SET,google,🎯 全球直连
  212. # - RULE-SET,direct,🎯 全球直连
  213. # - RULE-SET,telegram,📲 电报信息
  214. # - RULE-SET,gfw,🌎 国外网站
  215. # - RULE-SET,proxy,🌎 国外网站
  216. # - RULE-SET,greatfire,🌎 国外网站
  217. # - RULE-SET,streaming,🌎 国外网站
  218. - MATCH,proxy