Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
xishang0128 committed Sep 9, 2024
1 parent 51765ba commit e917f70
Show file tree
Hide file tree
Showing 10 changed files with 165 additions and 128 deletions.
5 changes: 2 additions & 3 deletions docs/config/dns/hosts.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ hosts:
'alpha.clash.dev': '::1'
test.com: [1.1.1.1, 2.2.2.2]
baidu.com: google.com
home.lan
```

hosts 域名支持通配,例如 `*.clash.dev``+.example.com`,别名 (示例最后两个) 不支持通配
键支持[域名通配](../../handbook/syntax.md#_8)

支持单域名多 ip,格式为数组
值支持字符串/数组,域名重定向不支持数组

!!! note
完整的的域名优先级高于使用通配符的域名,例如:foo.example.com > \*.example.com > .example.com
34 changes: 16 additions & 18 deletions docs/config/dns/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ dns:
- 223.5.5.5
enhanced-mode: fake-ip
fake-ip-range: 198.18.0.1/16
fake-ip-filter-mode: blacklist
fake-ip-filter:
- '*.lan'
- localhost.ptlogin2.qq.com
nameserver-policy:
'www.baidu.com': '114.114.114.114'
'+.internal.crop.com': '10.0.0.1'
'geosite:cn': https://doh.pub/dns-query
'+.arpa': '10.0.0.1'
'rule-set:cn':
- https://doh.pub/dns-query
- https://dns.alidns.com/dns-query
nameserver:
- https://doh.pub/dns-query
- https://dns.alidns.com/dns-query
Expand Down Expand Up @@ -47,7 +48,7 @@ dns:

## prefer-h3

优先使用 DOH http/3
DOH 优先使用 http/3

## listen

Expand All @@ -71,6 +72,12 @@ fakeip 下的 IP 段设置,[tun](../inbound/tun.md) 的默认 IPV4 地址 也

fakeip 过滤,以下地址不会下发 fakeip 映射用于连接

值支持[域名通配](../../handbook/syntax.md#_8)以及[引入域名集合](../../handbook/syntax.md#_13)

## fake-ip-filter-mode: blacklist

可选 `blacklist`/`whitelist`,默认`blacklist``,whitelist` 即只有匹配成功才返回 fake-ip

## use-hosts

是否回应配置中的 [hosts](./hosts.md),默认 true
Expand All @@ -81,7 +88,7 @@ fakeip 过滤,以下地址不会下发 fakeip 映射用于连接

## respect-rules

dns 连接跟随 rules,需配置 [proxy-server-nameserver](./index.md#proxy-server-nameserver)
dns 连接遵守[路由规则](../rules/index.md),需配置 [proxy-server-nameserver](./index.md#proxy-server-nameserver)

## default-nameserver

Expand All @@ -94,22 +101,13 @@ dns 连接跟随 rules,需配置 [proxy-server-nameserver](./index.md#proxy-se

指定域名查询的解析服务器,可使用 geosite, 优先于 `nameserver/fallback 查询`

!!! note
**以下仅作为书写演示,建议根据自己需求写**
键支持[域名通配](../../handbook/syntax.md#_8)

```{.yaml linenums="1"}
nameserver-policy:
'www.baidu.com': '114.114.114.114'
'+.internal.crop.com': '10.0.0.1'
'geosite:geolocation-!cn': [tls://8.8.4.4, https://1.0.0.1/dns-query]
'www.baidu.com,+.google.cn': https://doh.pub/dns-query
'geosite:private,apple': https://dns.alidns.com/dns-query
'rule-set:google,cloudflare': 8.8.8.8
```
值支持字符串/数组

## nameserver

默认的域名解析服务器,如不配置 `fallback/proxy-server-nameserver` , 则所有域名都由 nameserver 解析
默认的域名解析服务器

## proxy-server-nameserver

Expand Down
33 changes: 11 additions & 22 deletions docs/config/proxies/dialer-proxy.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,23 @@
# dialer-proxy

指定当前 `proxy` 通过下一跳的 `dialer-proxy` 建立网络连接,值可以为代理组、代理(proxy-groups, proxy)的同一 `name` 字段

```{.yaml linenums="1"}
proxies:
- name: "SS1"
type: ss
server: server
port: 443
dialer-proxy: SS2
- name: "ss1"
dialer-proxy: dialer
...
- name: "SS2"
type: ss
server: server
port: 443
- name: "ss2"
...
rules:
- match,SS1
proxy-groups:
- name: dialer
type: select
proxies:
- ss2
```

!!!Note
上面的例子通过在客户端的 proxies 内 `SS1` 指定 `proxy-dialer: SS2`,使发往 SS1 的流量先经过 SS2,从而实现指定下一跳代理的效果
指定当前 `proxies` 通过 `dialer-proxy` 建立网络连接,值可以为[策略组](../proxy-groups/index.md)/[出站代理](../proxies/index.md)`name`

```mermaid
flowchart LR
Clash <--> |proxy-proxy-dialer: SS2|SS2
SS2 <--> SS1
SS1 <--> 目标域名
上述示例中,ss1 通过 ss2 建立连接

```
当通过 ss1 代理时,就组成了一条 `内核>ss2>ss1>目标` 的代理链
2 changes: 1 addition & 1 deletion docs/config/proxies/hysteria2.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ proxies:

## ports

配置则启用端口跳跃,忽略`port`,格式参考[端口范围](../syntax.md#_13)
配置则启用端口跳跃,忽略`port`,格式参考[端口范围](../../handbook/syntax.md#_14)

## password

Expand Down
77 changes: 40 additions & 37 deletions docs/config/proxy-groups/index.en.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Common fields
# General Fields

```{.yaml linenums="1"}
proxy-groups:
Expand All @@ -15,6 +15,7 @@ proxy-groups:
interval: 300
lazy: true
timeout: 5000
max-failed-times: 5
disable-udp: true
interface-name: en0
Expand All @@ -32,129 +33,131 @@ proxy-groups:

## name

Required. The name of the policy group.
Required, the name of the proxy group.

!!! note
If there are special symbols, they should be enclosed in quotes.
If there are special characters, they should be enclosed in quotes.

## type

Required. The type of the policy group.
Required, the type of the proxy group.

## proxies

include [proxies](../proxies/index.md) or other proxy-groups.
References to [outbound proxies](../proxies/index.md) or other proxy groups.

## use

include [proxy-providers](../proxy-providers/index.md)
References to [proxy sets](../proxy-providers/index.md).

## url

Health check test URL.
Health check test address.

## interval

Health check interval. If not 0, enable periodic testing, in seconds.
Health check interval; if not 0, periodic testing is enabled, measured in seconds.

## lazy

Lazy mode. Default is `true`. Do not test unless this policy group is selected.
Lazy state, defaults to `true`. If the current proxy group is not selected, no testing is performed.

### timeout
## timeout

Health check timeout, in milliseconds.
Health check timeout, measured in milliseconds.

## max-failed-times

Maximum number of failures before triggering a forced health check. Default is 5.
Maximum number of failures; exceeding this triggers a forced health check, default is 5.

## disable-udp

Disable `UDP` for this proxy-groups.
Disables `UDP` for this proxy group.

## interface-name

Specify the [outbound interface](../general.md#_11) for the proxy-groups.
Specifies the [outbound interface](../general.md#_11) for the proxy group.

!!! info ""
Priority: Proxies > Proxy Groups > Global
Priority: Proxy Node > Proxy Policy > Global.

## routing-mark

Attach a [routing mark](../general.md#_12)when the proxy-groups goes outbound.
The [routing mark](../general.md#_12) attached when the proxy group is outbound.

!!! info ""
Priority: Proxies > Proxy Groups > Global
Priority: Proxy Node > Proxy Policy > Global.

## include-all

Include all [proxies](../proxies/index.md) and [proxy-providers](../proxy-providers/index.md).
Includes all [outbound proxies](../proxies/index.md) and [proxy sets](../proxy-providers/index.md), sorted by name.

!!! info ""
Includes without policy groups. Other policy groups can be included in [`proxies`](./index.md#proxies).
Inclusion does not include proxy groups; other proxy groups can be included in [proxies](./index.md#proxies).

## include-all-proxies

Include all [proxies](../proxies/index.md)
Includes all [outbound proxies](../proxies/index.md), sorted by name.

!!! info ""
Includes without policy groups. Other policy groups can be included in [`proxies`](./index.md#proxies).
Inclusion does not include proxy groups; other proxy groups can be included in [`proxies`](./index.md#proxies).

## include-all-providers

Include all [proxy-providers](../proxy-providers/index.md).
Includes all [proxy sets](../proxy-providers/index.md), sorted by name.

!!! info ""
This will disable [include proxy-providers](./index.md#use).
This will invalidate [including proxy sets](./index.md#use).

## filter

Filter nodes that meet the keywords or [regular expressions](https://github.com/ziishaned/learn-regex/blob/master/translations/README-cn.md). Multiple regular expressions can be separated by `.
Filters nodes that meet keywords or [regular expressions](https://github.com/ziishaned/learn-regex/blob/master/translations/README-cn.md). You can use ` to separate multiple regular expressions.

!!! info ""
Only applies to include proxy-providers and [include all outbound proxies](./index.md#include-all-proxies).
This only applies to included proxy sets and [including all outbound proxies](./index.md#include-all-proxies).

## exclude-filter

Exclude proxies that match keywords or [regular expressions](https://github.com/ziishaned/learn-regex/blob/master/translations/README-cn.md). Multiple regular expressions can be separated by `.
Excludes nodes that meet keywords or [regular expressions](https://github.com/ziishaned/learn-regex/blob/master/translations/README-cn.md). You can use ` to separate multiple regular expressions.

## exclude-type

Exclude proxies types.
Excludes node types.

Note that the syntax for `proxy-groups` and `proxy-providers` is different and does not support regular expressions. They are separated by `|`.
Note that the syntax for `proxy-groups` and `proxy-providers` is different; regular expressions are not supported, and should be separated by `|`.

## expected-status

Expected HTTP response status code during health check. If this field is configured, the node is considered available only when the response status code is consistent with the expected status. Default is `*`, indicating no requirements for the response status.
The expected HTTP response status code during health checks. If this field is configured, a node is considered available only when the response status code matches the expected status. The default is `*`, indicating no requirements on the response status.

### Syntax
### syntax

Use `/` to match multiple status codes, use `-` to match status code ranges, and mix the syntax.
You can use `/` to match multiple status codes, `-` to match a range of statuses, and mix them.

#### Examples
#### example

Match status codes 200 and 302:
Match status codes 200 and 302.

```{.yaml linenums="1"}
expected-status: 200/302
```

Match status codes from 400 to 503:
Match status codes from 400 to 503.

```{.yaml linenums="1"}
expected-status: 400-503
```

Match status codes 200 and 302, as well as from 400 to 503:
Match status codes 200 and 302, as well as from 400 to 503.

```{.yaml linenums="1"}
expected-status: 200/302/400-503
```

## hidden

Returns hidden status in the API to hide the display of this proxy-groups (requires front-end adaptation using the API).
Returns `hidden` status in the API to hide the display of this proxy group (requires front-end adaptation using the API).

## icon

Returns the string entered in icon in the API to display in this proxy-groups (requires front-end adaptation using the API).
Returns the string input for `icon` in the API to display in this proxy group (requires front-end adaptation using the API).
12 changes: 8 additions & 4 deletions docs/config/proxy-groups/relay.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ Proxy Groups:
- ss2
```

The traffic flow is `Clash` <-> `http` <-> `vmess` <-> `ss1` <-> `ss2` <-> `Internet`.
!!! warning
The relay strategy is about to be deprecated. Please use [dialer-proxy](../proxies/index.md#dialer-proxy).

## Regarding UDP
WireGuard currently does not support usage in relay, so please also use [dialer-proxy](../proxies/index.md#dialer-proxy).

Relay supports UDP transmission, provided that both the head and tail nodes of the proxy chain support UDP over TCP.
Currently, the protocols that support UDP include `vmess`, `vless`, `trojan`, `ss`, `ssr`, and `tuic`.
The traffic flow is Clash <-> http <-> vmess <-> ss1 <-> ss2 <-> Internet.

## About UDP

Relay supports the transmission of UDP, provided that both the head and tail nodes of the proxy chain support UDP over TCP. Currently, the protocols that support UDP include `vmess`, `vless`, `trojan`, `ss`, `ssr`, and `tuic`.
8 changes: 6 additions & 2 deletions docs/config/proxy-groups/relay.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ Proxy Groups:
- ss2
```

流量去向为 Clash <-> http <-> vmess <-> ss1 <-> ss2 <-> Internet
!!! warning
relay 策略即将被弃用,请使用[dialer-proxy](../proxies/index.md#dialer-proxy)

wireguard 目前不支持在 relay 中使用,也请使用[dialer-proxy](../proxies/index.md#dialer-proxy)

> wireguard 目前不支持在 relay 中使用。如果需要,请使用 proxy 中的 dialer-proxy 配置项

流量去向为 Clash <-> http <-> vmess <-> ss1 <-> ss2 <-> Internet

## 关于 UDP

Expand Down
8 changes: 4 additions & 4 deletions docs/config/rules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ rules:

### DST-PORT

匹配请求目标[端口范围](../syntax.md#_13)
匹配请求目标[端口范围](../../handbook/syntax.md#_14)

### SRC-PORT

匹配请求来源[端口范围](../syntax.md#_13)
匹配请求来源[端口范围](../../handbook/syntax.md#_14)

### IN-PORT

匹配[入站端口](../inbound/listeners/index.md#port),可用[端口范围](../syntax.md#_13)
匹配[入站端口](../inbound/listeners/index.md#port),可用[端口范围](../../handbook/syntax.md#_14)

### IN-TYPE

Expand Down Expand Up @@ -173,7 +173,7 @@ rules:

`LOGIC_TYPE,((payload1),(payload2)),Proxy`

*payload1**payload2* 为其他规则类型和它 payload,如:`DOMAIN,google.com`
*payload1**payload2* 为 规则类型和其他 payload,如:`DOMAIN,google.com`

逻辑规则,需要**注意括号**的使用

Expand Down
Loading

0 comments on commit e917f70

Please sign in to comment.