From 0eaf9855ee3399f8ad89c877daf380d7ccb4e823 Mon Sep 17 00:00:00 2001 From: Larvan2 <78135608+Larvan2@users.noreply.github.com> Date: Mon, 13 Feb 2023 17:56:05 +0800 Subject: [PATCH] Updated Configuring example (markdown) --- Configuring-example.md | 140 +++++++++++++++++++++-------------------- 1 file changed, 71 insertions(+), 69 deletions(-) diff --git a/Configuring-example.md b/Configuring-example.md index 9dd7631..4fdd9e0 100644 --- a/Configuring-example.md +++ b/Configuring-example.md @@ -34,51 +34,51 @@ ## General ```yaml -# port:7890 # HTTP(S) 代理服务器端口 -# socks-port:7891 # SOCKS5 代理端口 +# port: 7890 # HTTP(S) 代理服务器端口 +# socks-port: 7891 # SOCKS5 代理端口 mixed-port: 10801 # HTTP(S) 和 SOCKS 代理混合端口 -# redir-port:7892 # 透明代理端口,用于 Linux 和 MacOS +# redir-port: 7892 # 透明代理端口,用于 Linux 和 MacOS # Transparent proxy server port for Linux (TProxy TCP and TProxy UDP) -# tproxy-port:7893 +# tproxy-port: 7893 -allow-lan:true # 允许局域网连接 -bind-address:"*" # 绑定 IP 地址,仅作用于 allow-lan 为 true,'*'表示所有地址 +allow-lan: true # 允许局域网连接 +bind-address: "*" # 绑定 IP 地址,仅作用于 allow-lan 为 true,'*'表示所有地址 # find-process-mode has 3 values:always, strict, off # - always, 开启,强制匹配所有进程 # - strict, 默认,由 clash 判断是否开启 # - off, 不匹配进程,推荐在路由器上使用此模式 -find-process-mode:strict +find-process-mode: strict -mode:rule +mode: rule #自定义 geodata url geox-url: - geoip:"https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat" - geosite:"https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat" - mmdb:"https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/Country.mmdb" + geoip: "https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat" + geosite: "https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat" + mmdb: "https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/Country.mmdb" -log-level:debug # 日志等级 silent/error/warning/info/debug +log-level: debug # 日志等级 silent/error/warning/info/debug -ipv6:true # 开启 IPv6 总开关,关闭阻断所有 IPv6 链接和屏蔽 DNS 请求 AAAA 记录 +ipv6: true # 开启 IPv6 总开关,关闭阻断所有 IPv6 链接和屏蔽 DNS 请求 AAAA 记录 tls: - certificate:string # 证书 PEM 格式,或者 证书的路径 - private-key:string # 证书对应的私钥 PEM 格式,或者私钥路径 + certificate: string # 证书 PEM 格式,或者 证书的路径 + private-key: string # 证书对应的私钥 PEM 格式,或者私钥路径 -external-controller:0.0.0.0:9093 # RESTful API 监听地址 -external-controller-tls:0.0.0.0:9443 # RESTful API HTTPS 监听地址,需要配置 tls 部分配置文件 -# secret:"123456" # `Authorization:Bearer ${secret}` +external-controller: 0.0.0.0:9093 # RESTful API 监听地址 +external-controller-tls: 0.0.0.0:9443 # RESTful API HTTPS 监听地址,需要配置 tls 部分配置文件 +# secret: "123456" # `Authorization:Bearer ${secret}` -# tcp-concurrent:true # TCP 并发连接所有 IP, 将使用最快握手的 TCP -external-ui:/path/to/ui/folder # 配置 WEB UI 目录,使用 http://{{external-controller}}/ui 访问 +# tcp-concurrent: true # TCP 并发连接所有 IP, 将使用最快握手的 TCP +external-ui: /path/to/ui/folder # 配置 WEB UI 目录,使用 http://{{external-controller}}/ui 访问 -# interface-name:en0 # 设置出口网卡 +# interface-name: en0 # 设置出口网卡 -# global-client-fingerprint: 全局 TLS 指纹,优先低于 proxy 内的 client-fingerprint -# accepts "chrome","firefox","safari","ios","random","none" options. -# Utls is currently support TLS transport in TCP/grpc/WS/HTTP for VLESS/Vmess and trojan. +# 全局 TLS 指纹,优先低于 proxy 内的 client-fingerprint +# 可选: "chrome","firefox","safari","ios","random","none" options. +# Utls is currently support TLS transport in TCP/grpc/WS/HTTP for VLESS/Vmess and trojan. global-client-fingerprint: chrome # routing-mark:6666 # 配置 fwmark 仅用于 Linux @@ -86,16 +86,16 @@ experimental: # 类似于 /etc/hosts, 仅支持配置单个 IP hosts: -# '*.clash.dev':127.0.0.1 -# '.dev':127.0.0.1 -# 'alpha.clash.dev':'::1' +# '*.clash.dev': 127.0.0.1 +# '.dev': 127.0.0.1 +# 'alpha.clash.dev': '::1' profile: # 存储 select 选择记录 - store-selected:false + store-selected: false # 持久化 fake-ip - store-fake-ip:true + store-fake-ip: true ``` ## Tun @@ -104,39 +104,40 @@ Supports macOS, Linux and Windows. Built-in [Wintun](https://www.wintun.net) driver. ```yaml tun: - enable:false - stack:system # gvisor / lwip +tun: + enable: false + stack: system # gvisor / lwip dns-hijack: - 0.0.0.0:53 # 需要劫持的 DNS - auto-detect-interface:true # 自动识别出口网卡 - auto-route:true # 配置路由表 - # mtu:9000 # 最大传输单元 - # strict_route:true # 将所有连接路由到 tun 来防止泄漏,但你的设备将无法其他设备被访问 - # inet4_route_address:# 启用 auto_route 时使用自定义路由而不是默认路由 + auto-detect-interface: true # 自动识别出口网卡 + auto-route: true # 配置路由表 + # mtu: 9000 # 最大传输单元 + # strict_route: true # 将所有连接路由到tun来防止泄漏,但你的设备将无法其他设备被访问 + # inet4_route_address: # 启用 auto_route 时使用自定义路由而不是默认路由 # - 0.0.0.0/1 # - 128.0.0.0/1 - # inet6_route_address:# 启用 auto_route 时使用自定义路由而不是默认路由 + # inet6_route_address: # 启用 auto_route 时使用自定义路由而不是默认路由 # - "::/1" # - "8000::/1" - # endpoint_independent_nat:false # 启用独立于端点的 NAT - # include_uid:# UID 规则仅在 Linux 下被支持,并且需要 auto_route + # endpoint_independent_nat: false # 启用独立于端点的 NAT + # include_uid: # UID 规则仅在 Linux 下被支持,并且需要 auto_route # - 0 - # include_uid_range:# 限制被路由的的用户范围 + # include_uid_range: # 限制被路由的的用户范围 # - 1000-99999 - # exclude_uid:# 排除路由的的用户 + # exclude_uid: # 排除路由的的用户 #- 1000 - # exclude_uid_range:# 排除路由的的用户范围 + # exclude_uid_range: # 排除路由的的用户范围 # - 1000-99999 # Android 用户和应用规则仅在 Android 下被支持 # 并且需要 auto_route - # include_android_user:# 限制被路由的 Android 用户 + # include_android_user: # 限制被路由的 Android 用户 # - 0 # - 10 - # include_package:# 限制被路由的 Android 应用包名 + # include_package: # 限制被路由的 Android 应用包名 # - com.android.chrome - # exclude_package:# 排除被路由的 Android 应用包名 + # exclude_package: # 排除被路由的 Android 应用包名 # - com.android.captiveportallogin ``` @@ -144,9 +145,9 @@ tun: ```yaml ebpf: - auto-redir:# redirect 模式,仅支持 TCP + auto-redir: # redirect 模式,仅支持 TCP - eth0 - redirect-to-tun:# UDP+TCP 使用该功能请勿启用 auto-route + redirect-to-tun: # UDP+TCP 使用该功能请勿启用 auto-route - eth0 ``` @@ -154,31 +155,32 @@ ebpf: ```yaml sniffer: - enable:false + enable: false ## 对 redir-host 类型识别的流量进行强制嗅探 ## 如:Tun、Redir 和 TProxy 并 DNS 为 redir-host 皆属于 - # force-dns-mapping:false + # force-dns-mapping: false ## 对所有未获取到域名的流量进行强制嗅探 - # parse-pure-ip:false + # parse-pure-ip: false # 是否使用嗅探结果作为实际访问,默认 true # 全局配置,优先级低于 sniffer.sniff 实际配置 - override-destination:false + override-destination: false sniff: # TLS 默认如果不配置 ports 默认嗅探 443 TLS: - # ports:[443, 8443] + # ports: [443, 8443] + # 默认嗅探 80 HTTP: # 需要嗅探的端口 - ports:[80, 8080-8880] + + ports: [80, 8080-8880] # 可覆盖 sniffer.override-destination - override-destination:true + override-destination: true force-domain: - +.v2ex.com ## 对嗅探结果进行跳过 # skip-domain: # - Mijia Cloud - ``` ## tunnels @@ -188,20 +190,20 @@ tunnels: - tcp/udp,127.0.0.1:6553,114.114.114.114:53,proxy - tcp,127.0.0.1:6666,rds.mysql.com:3306,vpn # full yaml config - - network:[tcp, udp] - address:127.0.0.1:7777 - target:target.com - proxy:proxy + - network: [tcp, udp] + address: 127.0.0.1:7777 + target: target.com + proxy: proxy ``` ## DNS 配置 ```yaml dns: - enable:false # 关闭将使用系统 DNS - prefer-h3:true # 开启 DoH 支持 HTTP/3,将并发尝试 - listen:0.0.0.0:5353 # 开启 DNS 服务器监听 - # ipv6:false # false 将返回 AAAA 的空结果 + enable: false # 关闭将使用系统 DNS + prefer-h3: true # 开启 DoH 支持 HTTP/3,将并发尝试 + listen:0.0.0.0: 5353 # 开启 DNS 服务器监听 + # ipv6: false # false 将返回 AAAA 的空结果 # 用于解析 nameserver,fallback 以及其他 DNS 服务器配置的,DNS 服务域名 # 只能使用纯 IP 地址,可使用加密 DNS @@ -210,17 +212,17 @@ dns: - tls://1.12.12.12:853 - tls://223.5.5.5:853 - enhanced-mode:redir-host # or fake-ip + enhanced-mode: redir-host # or fake-ip - fake-ip-range:198.18.0.1/16 # fake-ip 池设置 + fake-ip-range: 198.18.0.1/16 # fake-ip 池设置 - # use-hosts:true # 查询 hosts + # use-hosts: true # 查询 hosts # 配置查询域名使用的 DNS 服务器 # nameserver-policy 可以使用 geosite 分流 DNS 解析。 # 将国内域名指定为国内 DOH 进行解析,其余 DNS 使用境外 DOH 解析 nameserver-policy: - "geosite:cn":[https://doh.pub/dns-query,https://dns.alidns.com/dns-query] + "geosite:cn": [https://doh.pub/dns-query,https://dns.alidns.com/dns-query] # 'www.baidu.com':'114.114.114.114' # '+.internal.crop.com':'10.0.0.1' @@ -261,8 +263,8 @@ dns: # 配置 fallback 使用条件 # fallback-filter: - # geoip:true # 配置是否使用 geoip - # geoip-code:CN # 当 nameserver 域名的 IP 查询 geoip 库为 CN 时,不使用 fallback 中的 DNS 查询结果 + # geoip: true # 配置是否使用 geoip + # geoip-code: CN # 当 nameserver 域名的 IP 查询 geoip 库为 CN 时,不使用 fallback 中的 DNS 查询结果 # 配置强制 fallback,优先于 IP 判断,具体分类自行查看 geosite 库 # geosite: # - "geolocation-!cn"