Update wireguard.md [ENG] (#435)

pull/443/head
ちか 2023-12-26 12:20:56 +08:00 committed by GitHub
parent b9a9ded54c
commit cc951bdb4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 48 additions and 10 deletions

View File

@ -26,7 +26,7 @@ Wireguard is a standard implementation of the Wireguard protocol.
"mtu": 1420, // optional, default 1420 "mtu": 1420, // optional, default 1420
"reserved": [1, 2, 3], "reserved": [1, 2, 3],
"workers": 2 // optional, default runtime.NumCPU() "workers": 2 // optional, default runtime.NumCPU()
"domainStrategy": "ForceIP" // Requires Xray-core v1.8.6 or higher "domainStrategy": "ForceIP"
} }
``` ```
@ -48,9 +48,11 @@ The fragment size of the underlying `tun` device in Wireguard.
> `reserved` \[ number \] > `reserved` \[ number \]
Wireguard Reserved Bytes.<br> Wireguard Reserved Bytes.
For example, when connecting to warp via wireguard, some IPs in Hong Kong and Los Angeles need to have a reserved value in order to connect successfully due to cloudflare limitations.<br>
The value of reserved can be obtained using third-party tools such as [warp-reg](https://github.com/badafans/warp-reg)、[warp-reg.sh](https://github.com/chise0713/warp-reg.sh) Xray-core v1.8.0 New parameter.<br>
When connecting to warp via wireguard, due to cloudflare limitations, some IPs in Hong Kong and Los Angeles need to have a `reserved` value in order to connect successfully.<br>
The value of `reserved` can be obtained using third-party tools such as [warp-reg](https://github.com/badafans/warp-reg), [warp-reg.sh](https://github.com/chise0713/warp-reg.sh).。
> `workers`: int > `workers`: int
@ -62,9 +64,46 @@ A list of Wireguard servers, where each item is a server configuration.
> `domainStrategy`: "ForceIPv6v4" | "ForceIPv6" | "ForceIPv4v6" | "ForceIPv4" | "ForceIP" > `domainStrategy`: "ForceIPv6v4" | "ForceIPv6" | "ForceIPv4v6" | "ForceIPv4" | "ForceIP"
Requires Xray-core v1.8.6 or higher.<br> Xray-core v1.8.6 New parameter.<br>
The default value is `"ForceIP"` when left blank.<br> If you do not write this parameter, or leave it blank, the default value is `"ForceIP"`.<br>
When the incoming request is for a domain name, regardless of whether `domainStrategy` is left empty (or if `domainStrategy` is not written), use the [built-in DNS server](./dns.md) to get an IP (if the DNS part is not written in the configuration, system DNS is used), and this IP is used to send the connection via wireguard. When the destination address is a domain name, use the Xray-core [built-in DNS server](./dns.md) to get an IP (if no `"dns"` configuration is written, system DNS is used), and send a connection to this IP via wireguard.<br>
| domainStrategy | test-ipv6.com | bgp.he.net | chat.openai.com |
| :--- | :---: | :---: | :---: |
| ForceIPv6v4 | IPv6v4 | IPv6 | IPv6 |
| ForceIPv6 | The website won't open. | IPv6 | IPv6 |
| ForceIPv4v6 | IPv6v4 **1** | IPv4 | IPv4 |
| ForceIPv4 | IPv4 | IPv4 | IPv4 |
| ForceIP | IPv6v4 **2** | IPv6 | IPv6 |
**1** Tip `You already have an IPv6 address, but your browser is less inclined to use it, which is more worrying. `<br>
**2** The chances of prompting `You already have an IPv6 address, but your browser is less inclined to use it, which is more worrisome. `
**Note 1**
- Conflicts with `"queryStrategy"` may cause the site to fail to open.
- For example when `domainStrategy: "ForceIPv4"` is used, geosite:openai's site with `"queryStrategy": "UseIPv6"` will fail to open.
```jsonc
"dns": {
"servers": [
"https://1.1.1.1/dns-query",
{
"address": "https://1.1.1.1/dns-query",
"domains": [
"geosite:openai"
],
"skipFallback": true,
"queryStrategy": "UseIPv6" // Query only AAAA records.
}
],
"queryStrategy": "UseIP" // If this parameter is not written, the default value is UseIP, i.e. both A and AAAA records are queried, optional values are UseIPv4 and UseIPv6, other record types are queried by the system DNS.
},
```
**Note 2**
- Xray-core v1.8.0 - v1.8.4 without `"domainStrategy"`.
- When the destination address is a domain name, use the Xray-core built-in DNS server query to obtain the IP, using the value of `"queryStrategy"` in the `"dns"` configuration to control the IPv4 or IPv6 priority.
- If the `"dns"` configuration is not written, the system DNS query is used to obtain IP, and the IPv4 or IPv6 priority is controlled by the system.
### Peers ### Peers
@ -82,9 +121,8 @@ When the incoming request is for a domain name, regardless of whether `domainStr
The server address. Required. The server address. Required.
::: tip URL:port format, e.g. `engage.cloudflareclient.com:2408`.<br>
Use the format `url:port`, for example, `engage.cloudflareclient.com:2408`. IP:port format, e.g. `162.159.192.1:2408` or `[2606:4700:d0::a29f:c001]:2408`.
:::
> `publicKey`: string > `publicKey`: string