From f457310e6819dc32149b30abf45a5461f73ef4c8 Mon Sep 17 00:00:00 2001 From: Larvan2 <78135608+Larvan2@users.noreply.github.com> Date: Sun, 5 Feb 2023 23:34:05 +0800 Subject: [PATCH] Updated Configuring example (markdown) --- Configuring-example.md | 157 +++++++++++++++++++++++++---------------- 1 file changed, 97 insertions(+), 60 deletions(-) diff --git a/Configuring-example.md b/Configuring-example.md index 69f1ac5..08b3eed 100644 --- a/Configuring-example.md +++ b/Configuring-example.md @@ -1,5 +1,5 @@ ## General -``` +```yaml # port:7890 # HTTP(S) 代理服务器端口 # socks-port:7891 # SOCKS5 代理端口 mixed-port:10801 # HTTP(S) 和 SOCKS 代理混合端口 @@ -65,7 +65,10 @@ profile: ``` ## Tun -``` +Supports macOS, Linux and Windows. + +Built-in [Wintun](https://www.wintun.net) driver. +```yaml tun: enable:false stack:system # gvisor / lwip @@ -105,7 +108,7 @@ tun: ## ebpf -``` +```yaml ebpf: auto-redir:# redirect 模式,仅支持 TCP - eth0 @@ -115,7 +118,7 @@ ebpf: ## sniffer -``` +```yaml sniffer: enable:false ## 对 redir-host 类型识别的流量进行强制嗅探 @@ -159,7 +162,7 @@ sniffer: ``` ## tunnels -``` +```yaml tunnels: # one line config - tcp/udp,127.0.0.1:6553,114.114.114.114:53,proxy @@ -173,7 +176,8 @@ tunnels: ## DNS 配置 -```dns: +```yaml +dns: enable:false # 关闭将使用系统 DNS prefer-h3:true # 开启 DoH 支持 HTTP/3,将并发尝试 listen:0.0.0.0:53 # 开启 DNS 服务器监听 @@ -248,7 +252,8 @@ tunnels: ``` ## Proxies -```proxies: +```yaml +proxies: # Shadowsocks # cipher 支持: # aes-128-gcm aes-192-gcm aes-256-gcm @@ -312,8 +317,10 @@ tunnels: plugin-opts: host:"cloud.tencent.com" password:"shadow_tls_password" +``` - # vmess +### vmess +```yaml # cipher 支持 auto/aes-128-gcm/chacha20-poly1305/none - name:"vmess" type:vmess @@ -412,8 +419,41 @@ tunnels: # sni:custom.com # fingerprint:xxxx # 同 experimental.fingerprints 使用 sha256 指纹,配置协议独立的指纹,将忽略 experimental.fingerprints # ip-version:dual +``` +### VLESS +```yaml + - name:"vless-tcp" + type:vless + server:server + port:443 + uuid:uuid + network:tcp + servername:example.com # AKA SNI + # flow:xtls-rprx-direct # xtls-rprx-origin # enable XTLS + # skip-cert-verify:true + # fingerprint:xxxx + # client-fingerprint:random # Available:"chrome","firefox","safari","random" - # Snell + - name:"vless-ws" + type:vless + server:server + port:443 + uuid:uuid + udp:true + tls:true + network:ws + # client-fingerprint:random # Available:"chrome","firefox","safari","random" + servername:example.com # priority over wss host + # skip-cert-verify:true + # fingerprint:xxxx + ws-opts: + path:"/" + headers: + Host:example.com +``` + +### Snell +```yaml # Beware that there's currently no UDP support yet - name:"snell" type:snell @@ -424,14 +464,16 @@ tunnels: # obfs-opts: # mode:http # or tls # host:bing.com +``` - # Trojan +### Trojan +```yaml - name:"trojan" type:trojan server:server port:443 password:yourpsk - # client-fingerprint:random # Available:"chrome","firefox","safari","random" + # client-fingerprint:chrome # Available:"chrome","firefox","safari","ios","random", currently only support TLS transport in TCP/GRPC/WS/HTTP for VLESS/Vmess and trojan. # fingerprint:xxxx # udp:true # sni:example.com # aka server name @@ -479,38 +521,12 @@ tunnels: # sni:example.com # aka server name # skip-cert-verify:true # fingerprint:xxxx +``` - # vless - - name:"vless-tcp" - type:vless - server:server - port:443 - uuid:uuid - network:tcp - servername:example.com # AKA SNI - # flow:xtls-rprx-direct # xtls-rprx-origin # enable XTLS - # skip-cert-verify:true - # fingerprint:xxxx - # client-fingerprint:random # Available:"chrome","firefox","safari","random" - - name:"vless-ws" - type:vless - server:server - port:443 - uuid:uuid - udp:true - tls:true - network:ws - # client-fingerprint:random # Available:"chrome","firefox","safari","random" - servername:example.com # priority over wss host - # skip-cert-verify:true - # fingerprint:xxxx - ws-opts: - path:"/" - headers: - Host:example.com - #hysteria +### Hysteria +```yaml - name:"hysteria" type:hysteria server:server.com @@ -535,17 +551,11 @@ tunnels: # disable_mtu_discovery:false # fingerprint:xxxx # fast-open:true # 支持 TCP 快速打开,默认为 false +``` - - name:"wg" - type:wireguard - server:162.159.192.1 - port:2480 - ip:172.16.0.2 - ipv6:fd01:5ca1:ab1e:80fa:ab85:6eea:213f:f4a5 - private-key:eCtXsJZ27+4PbhDkHnB923tkUn2Gj59wZw5wFA75MnU= - public-key:Cr8hWlKvtDt7nrvf+f0brNQQzabAqrjfBvas9pmowjo= - udp:true - # reserved:'U4An' + +### Tuic +```yaml - name:tuic server:www.example.com port:10443 @@ -563,8 +573,10 @@ tunnels: # fast-open:true # skip-cert-verify:true # max-open-streams:20 # default 100, too many open streams may hurt performance +``` - # ShadowsocksR +### ShadowsocksR +``` # The supported ciphers (encryption methods):all stream ciphers in ss # The supported obfses: # plain http_simple http_post @@ -585,8 +597,25 @@ tunnels: # udp:true ``` -## Proxy-groups +### Wireguard +```yaml + - name:"wg" + type:wireguard + server:162.159.192.1 + port:2480 + ip:172.16.0.2 + ipv6:fd01:5ca1:ab1e:80fa:ab85:6eea:213f:f4a5 + private-key:eCtXsJZ27+4PbhDkHnB923tkUn2Gj59wZw5wFA75MnU= + public-key:Cr8hWlKvtDt7nrvf+f0brNQQzabAqrjfBvas9pmowjo= + udp:true + # reserved:'U4An' ``` + +## Proxy-groups +Active health detection `urltest / fallback` (based on tcp handshake, multiple failures within a limited time will actively trigger health detection to use the node) + +Support `Policy Group Filter` +```yaml proxy-groups: # 代理链,若落地协议支持 UDP over TCP 则可支持 UDP # Traffic:clash <-> http <-> vmess <-> ss1 <-> ss2 <-> Internet @@ -660,7 +689,7 @@ proxy-groups: ``` ## Providers -### proxy-providers +### Proxy-providers ``` proxy-providers: provider1: @@ -682,8 +711,8 @@ proxy-providers: url:https://cp.cloudflare.com/generate_204 ``` -### rule-providers -``` +### Rule-providers +```yaml rule-providers: rule1: behavior:classical # domain ipcidr @@ -699,7 +728,15 @@ rule-providers: ``` ## Rules -```rules: +- Support rule `GEOSITE`. +- Support rule-providers `RULE-SET`. +- Support `multiport` condition for rule `SRC-PORT` and `DST-PORT`. +- Support `network` condition for all rules. +- Support source IPCIDR condition for all rules, just append to the end. +- The `GEOSITE` databases via https://github.com/Loyalsoldier/v2ray-rules-dat. + +```yaml +rules: - RULE-SET,rule1,REJECT - DOMAIN-SUFFIX,baidu.com,DIRECT - DOMAIN-KEYWORD,google,ss1 @@ -732,7 +769,7 @@ sub-rules: ``` ## Listeners -``` +```yaml # 流量入站 listeners: - name:socks5-in-1 @@ -866,17 +903,17 @@ listeners: 入口配置与 Listener 等价,传入流量将和 socks,mixed 等入口一样按照 mode 所指定的方式进行匹配处理 ### ss-config: -``` +```yaml ss://2022-blake3-aes-256-gcm:vlmpIPSyHH6f4S8WVPdRIHIlzmB+GIRfoH3aNJ/t9Gg=@:23456 ``` ### vmess-config: -``` +```yaml vmess://1:9d0cb9d0-964f-4ef6-897d-6c6b3ccf9e68@:12345 ``` ### tuic 服务器入口 传入流量将和 socks,mixed 等入口一样按照 mode 所指定的方式进行匹配处理 -``` +```yaml tuic-server: enable: true listen: 127.0.0.1:10443