From c564976a8c7e40ccde16aee22942cb278d46b183 Mon Sep 17 00:00:00 2001 From: mmmray <142015632+mmmray@users.noreply.github.com> Date: Mon, 23 Sep 2024 06:08:40 -0500 Subject: [PATCH] More type consistency fixes in config reference --- docs/config/dns.md | 10 +++++----- docs/config/transports/splithttp.md | 8 ++++---- docs/en/config/dns.md | 10 +++++----- docs/en/config/inbounds/shadowsocks.md | 4 ++-- docs/en/config/transports/splithttp.md | 14 +++++++------- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/config/dns.md b/docs/config/dns.md index 3658a22e3..fdb840b9e 100644 --- a/docs/config/dns.md +++ b/docs/config/dns.md @@ -100,9 +100,9 @@ Xray 内置的 DNS 模块,主要有两大用途: - 子串:由 `"keyword:"` 开始,余下部分是一个字符串。当此字符串匹配目标域名中任意部分,该规则生效。比如 "keyword:sina.com" 可以匹配 "sina.com"、"sina.com.cn" 和 "www.sina.com",但不匹配 "sina.cn"。 - 预定义域名列表:由 `"geosite:"` 开头,余下部分是一个名称,如 `geosite:google` 或者 `geosite:cn`。名称及域名列表参考 [预定义域名列表](./routing.md#预定义域名列表)。 -> `servers`: \[string | [ServerObject](#serverobject) \] +> `servers`: \[string | [DnsServerObject](#dnsserverobject) \] -一个 DNS 服务器列表,支持的类型有两种:DNS 地址(字符串形式)和 [ServerObject](#serverobject) 。 +一个 DNS 服务器列表,支持的类型有两种:DNS 地址(字符串形式)和 [DnsServerObject](#dnsserverobject) 。 当值为 `"localhost"` 时,表示使用本机预设的 DNS 配置。 @@ -141,7 +141,7 @@ Xray 内置的 DNS 模块,主要有两大用途: ::: ::: tip TIP 2 -可以在 [DnsObject](#dnsobject) 为所有 DNS 服务器指定 clientIp, 也可在每个 DNS 服务器配置的 [ServerObject](#serverobject) 为此 DNS 服务器指定 clientIp (优先级高于 [DnsObject](#dnsobject) 的配置)。 +可以在 [DnsObject](#dnsobject) 为所有 DNS 服务器指定 clientIp, 也可在每个 DNS 服务器配置的 [DnsServerObject](#dnsserverobject) 为此 DNS 服务器指定 clientIp (优先级高于 [DnsObject](#dnsobject) 的配置)。 ::: > `queryStrategy`: "UseIP" | "UseIPv4" | "UseIPv6" @@ -224,7 +224,7 @@ Xray-core v1.8.6 新增功能:`queryStrategy` 可以在每一项 `DNS` 服务 由内置 DNS 发出的查询流量,除 `localhost`、`fakedns`、`TCPL`、`DOHL` 和 `DOQL` 模式外,都可以用此标识在路由使用 `inboundTag` 进行匹配。 -### ServerObject +### DnsServerObject ```json { @@ -239,7 +239,7 @@ Xray-core v1.8.6 新增功能:`queryStrategy` 可以在每一项 `DNS` 服务 > `address`: address -一个 DNS 服务器列表,支持的类型有两种:DNS 地址(字符串形式)和 ServerObject 。 +一个 DNS 服务器列表,支持的类型有两种:DNS 地址(字符串形式)和 DnsServerObject 。 当值为 `"localhost"` 时,表示使用本机预设的 DNS 配置。 diff --git a/docs/config/transports/splithttp.md b/docs/config/transports/splithttp.md index da07336b0..ad0950bc0 100644 --- a/docs/config/transports/splithttp.md +++ b/docs/config/transports/splithttp.md @@ -53,7 +53,7 @@ SplitHTTP 的HTTP请求中所发送的host,默认值为空。若服务端值 仅客户端,自定义 HTTP 头,一个键值对,每个键表示一个 HTTP 头的名称,对应的值是字符串。 -> `scMaxEachPostBytes`: int/string +> `scMaxEachPostBytes`: int | string 上传分块的最大大小,单位为字节,默认值为 1000000, 即 1MB. @@ -63,7 +63,7 @@ SplitHTTP 的HTTP请求中所发送的host,默认值为空。若服务端值 也可以是字符串 "500000-1000000" 的形式,核心每次会在范围内随机选择一个值,以减少指纹。 -> `scMaxConcurrentPosts`: int/string +> `scMaxConcurrentPosts`: int | string 单个连接上传post的最大并发数,默认为100. @@ -73,7 +73,7 @@ SplitHTTP 的HTTP请求中所发送的host,默认值为空。若服务端值 也可以是字符串 "50-100" 的形式,核心每次会在范围内随机选择一个值,以减少指纹。 -> `scMinPostsIntervalMs`: int/string +> `scMinPostsIntervalMs`: int | string 仅客户端,发起POST上传请求的最小间隔。默认值为 30. @@ -83,7 +83,7 @@ SplitHTTP 的HTTP请求中所发送的host,默认值为空。若服务端值 仅服务端,不发送 `Content-Type: text/event-stream` 响应头,默认 `false` (即会发送) -> `xPaddingBytes` int/string +> `xPaddingBytes` int | string 设置请求(出站)和响应(入站)的填充大小,用于减少请求指纹。单位byte, 默认为 `"100-1000"` 每次会在该范围中随机选择一个数字。 也可以是单个数字 `"200"`/`200` diff --git a/docs/en/config/dns.md b/docs/en/config/dns.md index f5f2a447a..0fd05889e 100644 --- a/docs/en/config/dns.md +++ b/docs/en/config/dns.md @@ -103,9 +103,9 @@ The domain name can take several forms: - Substring: Starting with `"keyword:"`, the rest is a string. When this string matches any part of the target domain name, the rule takes effect. For example, "keyword:sina.com" can match "sina.com", "sina.com.cn", and "www.sina.com", but not "sina.cn". - Predefined domain name list: Starting with `"geosite:"`, the rest is a name, such as `geosite:google` or `geosite:cn`. The names and domain name lists are listed in [Predefined Domain Name Lists](#predefined-domain-name-lists). -> `servers`: [string | [ServerObject](#serverobject) ] +> `servers`: [string | [DnsServerObject](#dnsserverobject) ] -A list of DNS servers that supports two types: DNS addresses (in string format) and [ServerObject](#serverobject). +A list of DNS servers that supports two types: DNS addresses (in string format) and [DnsServerObject](#dnsserverobject). When the value is `"localhost"`, it means to use the default DNS configuration on the local machine. @@ -144,7 +144,7 @@ EDNS Client Subnet support is required for the DNS server. ::: ::: tip TIP 2 -You can specify `clientIp` for all DNS servers in [DnsObject](#dnsobject), or specify it for each DNS server in the configuration of [ServerObject](#serverobject) (which has higher priority than the configuration in [DnsObject](#dnsobject)). +You can specify `clientIp` for all DNS servers in [DnsObject](#dnsobject), or specify it for each DNS server in the configuration of [DnsServerObject](#dnsserverobject) (which has higher priority than the configuration in [DnsObject](#dnsobject)). ::: > `queryStrategy`: "UseIP" | "UseIPv4" | "UseIPv6" @@ -216,7 +216,7 @@ Subterm geosite:netflix query gets null response due to conflicting `"queryStrat Traffic generated by built-in DNS, except for `localhost`, `fakedns`, `TCPL`, `DOHL`, and `DOQL` modes, can be matched with `inboundTag` in routing using this identifier. -### ServerObject +### DnsServerObject ```json { @@ -231,7 +231,7 @@ Traffic generated by built-in DNS, except for `localhost`, `fakedns`, `TCPL`, `D > `address`: address -A list of DNS servers, which can be either DNS addresses (in string form) or ServerObjects. +A list of DNS servers, which can be either DNS addresses (in string form) or DnsServerObjects. When the value is `"localhost"`, it means using the local DNS configuration. diff --git a/docs/en/config/inbounds/shadowsocks.md b/docs/en/config/inbounds/shadowsocks.md index fcb3dafdb..358484c98 100644 --- a/docs/en/config/inbounds/shadowsocks.md +++ b/docs/en/config/inbounds/shadowsocks.md @@ -61,9 +61,9 @@ The supported network protocol type. For example, when specified as `"tcp"`, it } ``` -> `method`: string, any of the [supported methods](#supportedencryptionmethods) +> `method`: string -Required. +Required, any of the [supported methods](#supportedencryptionmethods) > `password`: string diff --git a/docs/en/config/transports/splithttp.md b/docs/en/config/transports/splithttp.md index 075c55f42..dd59a3b1f 100644 --- a/docs/en/config/transports/splithttp.md +++ b/docs/en/config/transports/splithttp.md @@ -56,7 +56,7 @@ The current priority of the `Host` header sent by clients: `host` > `headers` > Customized HTTP headers defined in key-value pairs. Defaults to empty. -> `scMaxEachPostBytes`: int/string +> `scMaxEachPostBytes`: int | string The maximum size of upload chunks, in bytes. Defaults to 1MB. @@ -70,7 +70,7 @@ or other HTTP reverse proxy, otherwise an HTTP 413 error will be thrown. It can also be in the form of a string `"1000000-2000000"`. The core will randomly select a value within the range each time to reduce fingerprints. -> `scMaxConcurrentPosts`: int/string +> `scMaxConcurrentPosts`: int | string The number of concurrent uploads to run. Defaults to 100 on the client, and 200 on the server. @@ -83,7 +83,7 @@ will be much lower. It can also be in the form of a string `"100-200"`, and the core will randomly select a value within the range each time to reduce fingerprints. -> `scMinPostsIntervalMs`: int/string +> `scMinPostsIntervalMs`: int | string (Client-only) How much time to pass between upload requests at a minimum. Defaults to `30` (milliseconds). @@ -130,19 +130,19 @@ Since the default is unlimited reuse, `xmux` actually limits this. It's not reco Terminology: *Streams* will reuse physical connections, as in, one connection can hold many streams. In other places, streams are called sub-connections, they are the same thing. -> `maxConcurrency`: int/string +> `maxConcurrency`: int | string Default 0 = infinite. The maximum number of streams reused in each connection. After the number of streams in the connection reaches this value, the core will create more connections to accommodate more streams, similar to the concurrency of mux.cool. Mutually exclusive with `maxConnections`. -> `maxConnections`: int/string +> `maxConnections`: int | string Default 0 = infinite. The maximum number of connections to open. Every stream will open a new connection until this value is reached, only then connections will be reused. Mutually exclusive with `maxConcurrency`. -> `cMaxReuseTimes`: int/string +> `cMaxReuseTimes`: int | string Default 0 = infinite. A connection can be reused at most several times. When this value is reached, the core will not allocate streams to the connection. It will be disconnected after the last internal stream is closed. -> `cMaxLifetimeMs`: int/string +> `cMaxLifetimeMs`: int | string Default 0 = infinite. How long can a connection "survive" at most? When the connection is open for more than this value, the core will not redistribute streams to the connection, and it will be disconnected after the last internal stream is closed.