Style: code style

This commit is contained in:
yaling888
2021-07-09 02:19:43 +08:00
parent 5852245045
commit 96e5a52651
5 changed files with 55 additions and 42 deletions

View File

@ -33,7 +33,7 @@ Documentations are now moved to [GitHub Wiki](https://github.com/Dreamacro/clash
## Advanced usage for this fork branch
### TUN configuration
Support macOS Linux and Windows.
Support macOS,Linux and Windows.
For Windows, you should download the [Wintun](https://www.wintun.net) driver and copy `wintun.dll` into the System32 directory.
```yaml
@ -45,19 +45,19 @@ tun:
auto-route: true # auto set global route
```
### Rules configuration
- Support rule `GEOSITE`
- Support `multiport` condition for rule `SRC-PORT` and `DST-PORT`
- Support not match condition for rule `GEOIP`
- Support `network` condition for all rules
- Support rule `GEOSITE`.
- Support `multiport` condition for rule `SRC-PORT` and `DST-PORT`.
- Support not match condition for rule `GEOIP`.
- Support `network` condition for all rules.
The `GEOSITE` and `GEOIP` databases via https://github.com/Loyalsoldier/v2ray-rules-dat
The `GEOSITE` and `GEOIP` databases via https://github.com/Loyalsoldier/v2ray-rules-dat.
```yaml
rules:
# network condition for rules
- DOMAIN-SUFFIX,bilibili.com,DIRECT,tcp
- DOMAIN-SUFFIX,bilibili.com,REJECT,udp
# multiport condition for rule SRC-PORT and DST-PORT
# multiport condition for rules SRC-PORT and DST-PORT
- DST-PORT,123/136/137-139,DIRECT,udp
# rule GEOSITE
@ -84,21 +84,34 @@ rules:
```
### Proxies configuration
Support outbound transport protocol `VLESS`
Support outbound transport protocol `VLESS`.
The XTLS only support TCP transport by the XRAY-CORE.
```yaml
proxies:
- name: "vless"
- name: "vless-tcp"
type: vless
server: server
port: 443
uuid: uuid
network: tcp
servername: example.com # AKA SNI
# udp: true
# flow: xtls-rprx-direct # xtls-rprx-origin # enable XTLS
# skip-cert-verify: true
# servername: example.com # priority over wss host
# network: ws # not support xtls
# ws-path: /path
# ws-headers:
# Host: v2ray.com
- name: "vless-ws"
type: vless
server: server
port: 443
uuid: uuid
udp: true
network: ws
servername: example.com # priority over wss host
# skip-cert-verify: true
ws-path: /path
ws-headers:
Host: example.com
- name: "vless-h2"
type: vless
@ -106,7 +119,8 @@ proxies:
port: 443
uuid: uuid
network: h2
# flow: xtls-rprx-direct # xtls-rprx-origin xtls-rprx-direct # enable xtls
servername: example.com
# skip-cert-verify: true
h2-opts:
host:
- http.example.com
@ -119,16 +133,17 @@ proxies:
port: 443
uuid: uuid
# udp: true
# network: http
# flow: xtls-rprx-direct # xtls-rprx-origin xtls-rprx-direct # enable xtls
# http-opts:
# # method: "GET"
# # path:
# # - '/'
# # - '/video'
# # headers:
# # Connection:
# # - keep-alive
network: http
servername: example.com
# skip-cert-verify: true
http-opts:
method: "GET"
path:
- '/'
- '/video'
headers:
Connection:
- keep-alive
- name: vless-grpc
server: server
@ -136,7 +151,6 @@ proxies:
type: vless
uuid: uuid
network: grpc
# flow: xtls-rprx-direct # xtls-rprx-origin xtls-rprx-direct # enable xtls
servername: example.com
# skip-cert-verify: true
grpc-opts:
@ -154,7 +168,7 @@ tproxy-port: 9898
tun:
enable: false
```
Create user given name `clash`
Create user given name `clash`.
Run Clash by user `clash` as a daemon.
@ -186,9 +200,9 @@ $ systemctl start clash
```
### Display Process name
Add field `Process` to `Metadata` and prepare to get process name for Restful API `GET /connections`
Add field `Process` to `Metadata` and prepare to get process name for Restful API `GET /connections`.
To display process name in GUI please use https://yaling888.github.io/yacd/
To display process name in GUI please use https://yaling888.github.io/yacd/.
## Premium Release
[Release](https://github.com/Dreamacro/clash/releases/tag/premium)