mcp-xray-pilot 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +502 -0
- package/data/docs/_index.json +533 -0
- package/data/docs/basic__api.md +148 -0
- package/data/docs/basic__dns.md +366 -0
- package/data/docs/basic__fakedns.md +202 -0
- package/data/docs/basic__geodata.md +64 -0
- package/data/docs/basic__inbound.md +159 -0
- package/data/docs/basic__index.md +136 -0
- package/data/docs/basic__log.md +67 -0
- package/data/docs/basic__metrics.md +262 -0
- package/data/docs/basic__observatory.md +115 -0
- package/data/docs/basic__outbound.md +164 -0
- package/data/docs/basic__policy.md +140 -0
- package/data/docs/basic__reverse.md +268 -0
- package/data/docs/basic__routing.md +474 -0
- package/data/docs/basic__stats.md +61 -0
- package/data/docs/basic__transport.md +1283 -0
- package/data/docs/features__features_browser_dialer.md +61 -0
- package/data/docs/features__features_env.md +66 -0
- package/data/docs/features__features_fallback.md +110 -0
- package/data/docs/features__features_index.md +17 -0
- package/data/docs/features__features_multiple.md +144 -0
- package/data/docs/features__features_xtls.md +13 -0
- package/data/docs/inbounds__inbounds_dokodemo.md +11 -0
- package/data/docs/inbounds__inbounds_http.md +80 -0
- package/data/docs/inbounds__inbounds_hysteria.md +60 -0
- package/data/docs/inbounds__inbounds_index.md +22 -0
- package/data/docs/inbounds__inbounds_shadowsocks.md +118 -0
- package/data/docs/inbounds__inbounds_socks.md +87 -0
- package/data/docs/inbounds__inbounds_trojan.md +78 -0
- package/data/docs/inbounds__inbounds_tun.md +47 -0
- package/data/docs/inbounds__inbounds_tunnel.md +86 -0
- package/data/docs/inbounds__inbounds_vless.md +135 -0
- package/data/docs/inbounds__inbounds_vmess.md +95 -0
- package/data/docs/inbounds__inbounds_wireguard.md +78 -0
- package/data/docs/outbounds__outbounds_blackhole.md +42 -0
- package/data/docs/outbounds__outbounds_dns.md +97 -0
- package/data/docs/outbounds__outbounds_freedom.md +170 -0
- package/data/docs/outbounds__outbounds_http.md +70 -0
- package/data/docs/outbounds__outbounds_hysteria.md +39 -0
- package/data/docs/outbounds__outbounds_index.md +24 -0
- package/data/docs/outbounds__outbounds_loopback.md +65 -0
- package/data/docs/outbounds__outbounds_shadowsocks.md +105 -0
- package/data/docs/outbounds__outbounds_socks.md +58 -0
- package/data/docs/outbounds__outbounds_trojan.md +49 -0
- package/data/docs/outbounds__outbounds_vless.md +122 -0
- package/data/docs/outbounds__outbounds_vmess.md +76 -0
- package/data/docs/outbounds__outbounds_wireguard.md +141 -0
- package/data/docs/transports__transports_grpc.md +137 -0
- package/data/docs/transports__transports_h2.md +11 -0
- package/data/docs/transports__transports_http.md +11 -0
- package/data/docs/transports__transports_httpupgrade.md +61 -0
- package/data/docs/transports__transports_hysteria.md +110 -0
- package/data/docs/transports__transports_index.md +19 -0
- package/data/docs/transports__transports_mkcp.md +125 -0
- package/data/docs/transports__transports_quic.md +11 -0
- package/data/docs/transports__transports_raw.md +156 -0
- package/data/docs/transports__transports_splithttp.md +11 -0
- package/data/docs/transports__transports_tcp.md +11 -0
- package/data/docs/transports__transports_websocket.md +75 -0
- package/data/docs/transports__transports_xhttp.md +11 -0
- package/dist/data/compatibility.js +170 -0
- package/dist/data/compatibility.js.map +1 -0
- package/dist/data/geocatalogue.js +191 -0
- package/dist/data/geocatalogue.js.map +1 -0
- package/dist/docs.js +339 -0
- package/dist/docs.js.map +1 -0
- package/dist/handlers.js +217 -0
- package/dist/handlers.js.map +1 -0
- package/dist/index.js +66 -0
- package/dist/index.js.map +1 -0
- package/dist/lint.js +737 -0
- package/dist/lint.js.map +1 -0
- package/dist/schemas/protocols/blackhole.js +16 -0
- package/dist/schemas/protocols/blackhole.js.map +1 -0
- package/dist/schemas/protocols/common.js +32 -0
- package/dist/schemas/protocols/common.js.map +1 -0
- package/dist/schemas/protocols/dns.js +14 -0
- package/dist/schemas/protocols/dns.js.map +1 -0
- package/dist/schemas/protocols/dokodemo.js +17 -0
- package/dist/schemas/protocols/dokodemo.js.map +1 -0
- package/dist/schemas/protocols/freedom.js +45 -0
- package/dist/schemas/protocols/freedom.js.map +1 -0
- package/dist/schemas/protocols/http.js +38 -0
- package/dist/schemas/protocols/http.js.map +1 -0
- package/dist/schemas/protocols/hysteria.js +51 -0
- package/dist/schemas/protocols/hysteria.js.map +1 -0
- package/dist/schemas/protocols/index.js +50 -0
- package/dist/schemas/protocols/index.js.map +1 -0
- package/dist/schemas/protocols/loopback.js +11 -0
- package/dist/schemas/protocols/loopback.js.map +1 -0
- package/dist/schemas/protocols/shadowsocks.js +60 -0
- package/dist/schemas/protocols/shadowsocks.js.map +1 -0
- package/dist/schemas/protocols/socks.js +42 -0
- package/dist/schemas/protocols/socks.js.map +1 -0
- package/dist/schemas/protocols/trojan.js +34 -0
- package/dist/schemas/protocols/trojan.js.map +1 -0
- package/dist/schemas/protocols/tun.js +19 -0
- package/dist/schemas/protocols/tun.js.map +1 -0
- package/dist/schemas/protocols/vless.js +44 -0
- package/dist/schemas/protocols/vless.js.map +1 -0
- package/dist/schemas/protocols/vmess.js +48 -0
- package/dist/schemas/protocols/vmess.js.map +1 -0
- package/dist/schemas/protocols/wireguard.js +34 -0
- package/dist/schemas/protocols/wireguard.js.map +1 -0
- package/dist/schemas/security/index.js +16 -0
- package/dist/schemas/security/index.js.map +1 -0
- package/dist/schemas/security/reality.js +35 -0
- package/dist/schemas/security/reality.js.map +1 -0
- package/dist/schemas/security/tls.js +46 -0
- package/dist/schemas/security/tls.js.map +1 -0
- package/dist/schemas/security/xtls.js +17 -0
- package/dist/schemas/security/xtls.js.map +1 -0
- package/dist/schemas/transports/grpc.js +18 -0
- package/dist/schemas/transports/grpc.js.map +1 -0
- package/dist/schemas/transports/httpupgrade.js +14 -0
- package/dist/schemas/transports/httpupgrade.js.map +1 -0
- package/dist/schemas/transports/hysteria.js +25 -0
- package/dist/schemas/transports/hysteria.js.map +1 -0
- package/dist/schemas/transports/index.js +32 -0
- package/dist/schemas/transports/index.js.map +1 -0
- package/dist/schemas/transports/mkcp.js +34 -0
- package/dist/schemas/transports/mkcp.js.map +1 -0
- package/dist/schemas/transports/raw.js +19 -0
- package/dist/schemas/transports/raw.js.map +1 -0
- package/dist/schemas/transports/websocket.js +15 -0
- package/dist/schemas/transports/websocket.js.map +1 -0
- package/dist/schemas/transports/xhttp.js +34 -0
- package/dist/schemas/transports/xhttp.js.map +1 -0
- package/dist/search.js +78 -0
- package/dist/search.js.map +1 -0
- package/dist/state.js +87 -0
- package/dist/state.js.map +1 -0
- package/dist/tools.js +274 -0
- package/dist/tools.js.map +1 -0
- package/dist/tools_impl/diff.js +55 -0
- package/dist/tools_impl/diff.js.map +1 -0
- package/dist/tools_impl/github.js +416 -0
- package/dist/tools_impl/github.js.map +1 -0
- package/dist/tools_impl/merge.js +181 -0
- package/dist/tools_impl/merge.js.map +1 -0
- package/dist/tools_impl/refresh.js +46 -0
- package/dist/tools_impl/refresh.js.map +1 -0
- package/dist/tools_impl/suggest.js +169 -0
- package/dist/tools_impl/suggest.js.map +1 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.js +81 -0
- package/dist/utils.js.map +1 -0
- package/dist/validate.js +408 -0
- package/dist/validate.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,1283 @@
|
|
|
1
|
+
---
|
|
2
|
+
url: https://xtls.github.io/en/config/transport.html
|
|
3
|
+
source_url: https://raw.githubusercontent.com/XTLS/Xray-docs-next/main/docs/en/config/transport.md
|
|
4
|
+
title: Transport (uTLS, REALITY)
|
|
5
|
+
category: basic
|
|
6
|
+
slug: transport
|
|
7
|
+
fetched_at: 2026-05-04T18:42:43.082Z
|
|
8
|
+
---
|
|
9
|
+
# Transport (uTLS, REALITY)
|
|
10
|
+
|
|
11
|
+
Transport is the method used by the current Xray node to establish connections with other nodes.
|
|
12
|
+
|
|
13
|
+
Transport specifies a stable method for data transmission. Generally, both ends of a network connection need to have symmetrical transport methods. For example, if one end uses WebSocket, the other end must also use WebSocket; otherwise, the connection cannot be established.
|
|
14
|
+
|
|
15
|
+
## StreamSettingsObject
|
|
16
|
+
|
|
17
|
+
`StreamSettingsObject` corresponds to the `streamSettings` item in inbound or outbound configurations. Each inbound or outbound can be configured with different transport settings independently, and `streamSettings` can be set to perform some transport configurations.
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"network": "raw",
|
|
22
|
+
"security": "none",
|
|
23
|
+
"tlsSettings": {},
|
|
24
|
+
"realitySettings": {},
|
|
25
|
+
"rawSettings": {},
|
|
26
|
+
"xhttpSettings": {},
|
|
27
|
+
"kcpSettings": {},
|
|
28
|
+
"grpcSettings": {},
|
|
29
|
+
"wsSettings": {},
|
|
30
|
+
"httpupgradeSettings": {},
|
|
31
|
+
"hysteriaSettings": {},
|
|
32
|
+
"finalmask": {
|
|
33
|
+
"tcp": [],
|
|
34
|
+
"udp": [],
|
|
35
|
+
"quicParams": {}
|
|
36
|
+
},
|
|
37
|
+
"sockopt": {
|
|
38
|
+
"mark": 0,
|
|
39
|
+
"tcpMaxSeg": 1440,
|
|
40
|
+
"tcpFastOpen": false,
|
|
41
|
+
"tproxy": "off",
|
|
42
|
+
"domainStrategy": "AsIs",
|
|
43
|
+
"happyEyeballs": {},
|
|
44
|
+
"dialerProxy": "",
|
|
45
|
+
"acceptProxyProtocol": false,
|
|
46
|
+
"tcpKeepAliveInterval": 0,
|
|
47
|
+
"tcpKeepAliveIdle": 300,
|
|
48
|
+
"tcpUserTimeout": 10000,
|
|
49
|
+
"tcpCongestion": "bbr",
|
|
50
|
+
"interface": "wg0",
|
|
51
|
+
"v6only": false,
|
|
52
|
+
"tcpWindowClamp": 600,
|
|
53
|
+
"tcpMptcp": false
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
> `network`: "raw" | "xhttp" | "kcp" | "grpc" | "ws" | "httpupgrade" | "hysteria"
|
|
59
|
+
|
|
60
|
+
The type of transport method used for the connection data stream. The default value is `"raw"`.
|
|
61
|
+
|
|
62
|
+
::: tip
|
|
63
|
+
After version v24.9.30, to better reflect actual behavior, the TCP transport method has been renamed to RAW. For compatibility, `"network": "raw"` and `"network": "tcp"`, as well as `rawSettings` and `tcpSettings`, are aliases for each other.
|
|
64
|
+
:::
|
|
65
|
+
|
|
66
|
+
> `security`: "none" | "tls" | "reality"
|
|
67
|
+
|
|
68
|
+
Whether to enable transport layer encryption. Supported options are:
|
|
69
|
+
|
|
70
|
+
- `"none"`: Indicates no encryption (default value).
|
|
71
|
+
- `"tls"`: Indicates using [TLS](https://en.wikipedia.org/wiki/Transport_Layer_Security).
|
|
72
|
+
- `"reality"`: Indicates using REALITY.
|
|
73
|
+
|
|
74
|
+
> `tlsSettings`: [TLSObject](#tlsobject)
|
|
75
|
+
|
|
76
|
+
TLS configuration. TLS is provided by Golang. Usually, the TLS negotiation result is TLS 1.3. DTLS is not supported.
|
|
77
|
+
|
|
78
|
+
> `realitySettings`: [RealityObject](#realityobject)
|
|
79
|
+
|
|
80
|
+
Reality configuration. Reality is an original black technology from Xray. Reality offers higher security than TLS, and its configuration method is consistent with TLS.
|
|
81
|
+
|
|
82
|
+
::: tip
|
|
83
|
+
Reality is currently the most secure transport encryption scheme, and the traffic type appears consistent with normal web browsing from the outside. Enabling Reality and configuring an appropriate XTLS Vision flow control mode can achieve several times or even more than ten times performance improvement.
|
|
84
|
+
:::
|
|
85
|
+
|
|
86
|
+
> `rawSettings`: [RawObject](./transports/raw.md)
|
|
87
|
+
|
|
88
|
+
RAW configuration for the current connection. Only valid when this connection uses RAW.
|
|
89
|
+
|
|
90
|
+
> `xhttpSettings`: [XHTTP: Beyond REALITY](https://github.com/XTLS/Xray-core/discussions/4113)
|
|
91
|
+
|
|
92
|
+
XHTTP configuration for the current connection. Only valid when this connection uses XHTTP.
|
|
93
|
+
|
|
94
|
+
> `kcpSettings`: [KcpObject](./transports/mkcp.md)
|
|
95
|
+
|
|
96
|
+
mKCP configuration for the current connection. Only valid when this connection uses mKCP.
|
|
97
|
+
|
|
98
|
+
> `grpcSettings`: [GRPCObject](./transports/grpc.md)
|
|
99
|
+
|
|
100
|
+
gRPC configuration for the current connection. Only valid when this connection uses gRPC.
|
|
101
|
+
|
|
102
|
+
> `wsSettings`: [WebSocketObject](./transports/websocket.md)
|
|
103
|
+
|
|
104
|
+
WebSocket configuration for the current connection. Only valid when this connection uses WebSocket.
|
|
105
|
+
|
|
106
|
+
> `httpupgradeSettings`: [HttpUpgradeObject](./transports/httpupgrade.md)
|
|
107
|
+
|
|
108
|
+
HTTPUpgrade configuration for the current connection. Only valid when this connection uses HTTPUpgrade.
|
|
109
|
+
|
|
110
|
+
> `hysteriaSettings`: [HysteriaObject](./transports/hysteria.md)
|
|
111
|
+
|
|
112
|
+
Hysteria configuration for the current connection. Only valid when this connection uses Hysteria.
|
|
113
|
+
|
|
114
|
+
> `sockopt`: [SockoptObject](#sockoptobject)
|
|
115
|
+
|
|
116
|
+
Specific configurations related to transparent proxying.
|
|
117
|
+
|
|
118
|
+
> `finalmask`: [FinalMaskObject](#finalmaskobject)
|
|
119
|
+
|
|
120
|
+
FinalMask configuration, used for general traffic obfuscation.
|
|
121
|
+
|
|
122
|
+
### TLSObject
|
|
123
|
+
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"serverName": "xray.com",
|
|
127
|
+
"verifyPeerCertByName": "",
|
|
128
|
+
"rejectUnknownSni": false,
|
|
129
|
+
"allowInsecure": false,
|
|
130
|
+
"alpn": ["h2", "http/1.1"],
|
|
131
|
+
"minVersion": "1.2",
|
|
132
|
+
"maxVersion": "1.3",
|
|
133
|
+
"cipherSuites": "Enter the cipher suite names you need here, separated by :",
|
|
134
|
+
"certificates": [],
|
|
135
|
+
"disableSystemRoot": false,
|
|
136
|
+
"enableSessionResumption": false,
|
|
137
|
+
"fingerprint": "",
|
|
138
|
+
"pinnedPeerCertSha256": "",
|
|
139
|
+
"curvePreferences": [""],
|
|
140
|
+
"masterKeyLog": "",
|
|
141
|
+
"echServerKeys": "",
|
|
142
|
+
"echConfigList": "",
|
|
143
|
+
"echSockopt": {}
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
> `serverName`: string
|
|
148
|
+
|
|
149
|
+
Server name. The server certificate's SAN must contain this value. It can be a domain name or an IP address. If it is a domain name, it will be sent in the SNI extension of the Client Hello. IP addresses will not send the SNI extension (SNI extension does not allow IP addresses). If filling in IPv6, use `[]` to wrap it.
|
|
150
|
+
|
|
151
|
+
When left empty, the value in `address` (if it is a domain name) is automatically used.
|
|
152
|
+
|
|
153
|
+
Special value `"FromMitM"`: This causes it to use the SNI contained in the TLS decrypted from the dokodemo-door inbound.
|
|
154
|
+
|
|
155
|
+
> `verifyPeerCertByName`: string
|
|
156
|
+
|
|
157
|
+
Client-only. The SNI used for certificate verification. Multiple domains can be separated by `,` (only one SAN in the certificate needs to be in this list). This will override the `serverName` used for verification, intended for special purposes such as domain fronting.
|
|
158
|
+
|
|
159
|
+
Special value `"FromMitM"`: This causes it to additionally include the SNI contained in the TLS decrypted from the dokodemo-door inbound.
|
|
160
|
+
|
|
161
|
+
> `rejectUnknownSni`: bool
|
|
162
|
+
|
|
163
|
+
When set to `true`, the server refuses the TLS handshake if the received SNI does not match the certificate domain. Default is `false`.
|
|
164
|
+
|
|
165
|
+
> `alpn`: \[ string \]
|
|
166
|
+
|
|
167
|
+
An array of strings specifying the ALPN values during TLS handshake. Default value is `["h2", "http/1.1"]`.
|
|
168
|
+
|
|
169
|
+
Special value: `["FromMitM"]` (when this is the only element) will cause the outbound TLS to use the ALPN used by the TLS connection decrypted from the dokodemo-door inbound.
|
|
170
|
+
|
|
171
|
+
> `minVersion`: string
|
|
172
|
+
|
|
173
|
+
`minVersion` is the minimum acceptable TLS version.
|
|
174
|
+
|
|
175
|
+
> `maxVersion`: string
|
|
176
|
+
|
|
177
|
+
`maxVersion` is the maximum acceptable TLS version.
|
|
178
|
+
|
|
179
|
+
> `cipherSuites`: string
|
|
180
|
+
|
|
181
|
+
`CipherSuites` is used to configure the list of supported cipher suites, separated by `:`.
|
|
182
|
+
|
|
183
|
+
You can find Golang cipher suite names and descriptions [here](https://golang.org/src/crypto/tls/cipher_suites.go#L500) or [here](https://golang.org/src/crypto/tls/cipher_suites.go#L44).
|
|
184
|
+
|
|
185
|
+
::: danger
|
|
186
|
+
The above two configuration items are optional and usually do not affect security. Golang automatically selects based on the device when not configured. Do not configure this option if you are unfamiliar with it; you are responsible for issues caused by improper configuration.
|
|
187
|
+
:::
|
|
188
|
+
|
|
189
|
+
> `allowInsecure`: true | false
|
|
190
|
+
|
|
191
|
+
Whether to allow insecure connections (client-only). Default value is `false`.
|
|
192
|
+
|
|
193
|
+
When set to `true`, Xray will not check the validity of the TLS certificate provided by the remote host.
|
|
194
|
+
|
|
195
|
+
::: danger
|
|
196
|
+
~~For security reasons, this option should not be set to `true` in actual scenarios, otherwise, you may suffer from Man-in-the-Middle attacks.~~
|
|
197
|
+
|
|
198
|
+
This option is deprecated. Use `pinnedPeerCertSha256` to manually specify the required certificate.
|
|
199
|
+
:::
|
|
200
|
+
|
|
201
|
+
> `disableSystemRoot`: true | false
|
|
202
|
+
|
|
203
|
+
Whether to disable the operating system's built-in CA certificates. Default value is `false`.
|
|
204
|
+
|
|
205
|
+
When set to `true`, Xray will only use certificates specified in `certificates` for TLS handshake. When set to `false`, Xray will only use the OS's built-in CA certificates for TLS handshake.
|
|
206
|
+
|
|
207
|
+
> `enableSessionResumption`: true | false
|
|
208
|
+
|
|
209
|
+
Whether to enable session resumption. Disabled by default. Session resumption negotiation will only be attempted when both the server and client enable it.
|
|
210
|
+
|
|
211
|
+
If negotiation is successful, certificates do not need to be transmitted during the handshake. Saves a tiny bit of handshake time (almost negligible).
|
|
212
|
+
|
|
213
|
+
Note: This is not TLS 0-RTT. gotls does not support this feature yet. It will not reduce the RTT of the TLS handshake.
|
|
214
|
+
|
|
215
|
+
> `fingerprint` : string
|
|
216
|
+
|
|
217
|
+
This parameter is used to configure the fingerprint of the specified `TLS Client Hello`. Default is `chrome`. To revert to native go TLS, set to `unsafe`. When enabled, Xray will **simulate** `TLS` fingerprints via the uTLS library or generate them randomly. Supports three configuration methods:
|
|
218
|
+
|
|
219
|
+
1. Latest versions of common browsers, including:
|
|
220
|
+
- `"chrome"`
|
|
221
|
+
- `"firefox"`
|
|
222
|
+
- `"safari"`
|
|
223
|
+
- `"ios"`
|
|
224
|
+
- `"android"`
|
|
225
|
+
- `"edge"`
|
|
226
|
+
- `"360"`
|
|
227
|
+
- `"qq"`
|
|
228
|
+
|
|
229
|
+
2. Automatically generate a fingerprint when Xray starts:
|
|
230
|
+
- `"random"`: Randomly select one from newer browser versions.
|
|
231
|
+
- `"randomized"`: Completely randomly generate a unique fingerprint (100% supports TLS 1.3 using X25519).
|
|
232
|
+
|
|
233
|
+
3. Use uTLS native fingerprint variable names, e.g., `"HelloRandomizedNoALPN"`, `"HelloChrome_106_Shuffle"`. See the [uTLS library](https://github.com/refraction-networking/utls/blob/master/u_common.go#L434) for the full list.
|
|
234
|
+
|
|
235
|
+
::: tip
|
|
236
|
+
This feature only **simulates** the `TLS Client Hello` fingerprint. Behavior and other fingerprints are the same as Golang. If you wish to simulate browser `TLS` fingerprints and behavior more completely, you can use [Browser Dialer](./transports/websocket.md#browser-dialer).
|
|
237
|
+
:::
|
|
238
|
+
|
|
239
|
+
::: tip
|
|
240
|
+
When using this feature, some TLS options affecting TLS fingerprints will be overwritten by the uTLS library and will no longer take effect, such as ALPN.
|
|
241
|
+
Parameters passed include:
|
|
242
|
+
`"serverName"`, `"disableSystemRoot"`, `"pinnedPeerCertSha256"`, `"masterKeyLog"`.
|
|
243
|
+
:::
|
|
244
|
+
|
|
245
|
+
> `pinnedPeerCertSha256`: string
|
|
246
|
+
|
|
247
|
+
Used to specify the SHA256 hash of the remote server's certificate. It uses hex encoding and is case-insensitive. For example: `e8e2d387fdbffeb38e9c9065cf30a97ee23c0e3d32ee6f78ffae40966befccc9`. You can specify multiple hash values separated by `,`; verification passes if any of them match.
|
|
248
|
+
|
|
249
|
+
This encoding matches the SHA-256 Certificate Fingerprint found in the Chrome certificate viewer and the format used on crt.sh. You can calculate it using `xray tls hash --cert <cert.pem>` or `openssl x509 -noout -fingerprint -sha256 -in cert.pem` (the format with colons generated by OpenSSL is supported). Additionally, `xray tls ping` will output the remote certificate's SHA256 hash.
|
|
250
|
+
|
|
251
|
+
This mechanism overrides the default certificate validation and operates in two scenarios:
|
|
252
|
+
|
|
253
|
+
- 1. If the core finds that the matching hash belongs to a leaf certificate, verification passes immediately.
|
|
254
|
+
- 2. If the core finds that the matching hash belongs to a CA certificate (either a root or intermediate certificate), it will use the value in `serverName` to verify if the leaf certificate is validly signed by that CA.
|
|
255
|
+
|
|
256
|
+
> `certificates`: \[ [CertificateObject](#certificateobject) \]
|
|
257
|
+
|
|
258
|
+
List of certificates, where each item represents a certificate (fullchain is recommended).
|
|
259
|
+
|
|
260
|
+
::: tip
|
|
261
|
+
If you want to get an A/A+ rating on ssllibs or myssl, please refer to [this discussion](https://github.com/XTLS/Xray-core/discussions/56#discussioncomment-215600).
|
|
262
|
+
:::
|
|
263
|
+
|
|
264
|
+
> `curvePreferences`: \[ string \]
|
|
265
|
+
|
|
266
|
+
An array of strings specifying the curves supported when performing ECDHE in TLS handshake. Supported curves are as follows (case-insensitive):
|
|
267
|
+
|
|
268
|
+
```
|
|
269
|
+
CurveP256
|
|
270
|
+
CurveP384
|
|
271
|
+
CurveP521
|
|
272
|
+
X25519
|
|
273
|
+
X25519MLKEM768
|
|
274
|
+
SecP256r1MLKEM768*
|
|
275
|
+
SecP384r1MLKEM1024*
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
\*: Not supported by utls
|
|
279
|
+
|
|
280
|
+
The default value as of go1.26 includes all of the above curves. Adjusting the order does not make the client or server prefer a particular curve; the actual curve will be negotiated by the key exchange mechanism itself.
|
|
281
|
+
|
|
282
|
+
> `masterKeyLog` : string
|
|
283
|
+
|
|
284
|
+
(Pre)-Master-Secret log file path, can be used by software like Wireshark to decrypt TLS connections sent by Xray.
|
|
285
|
+
|
|
286
|
+
> `echServerKeys` : string
|
|
287
|
+
|
|
288
|
+
Server-only parameter. Used to enable Encrypted Client Hello on the server.
|
|
289
|
+
|
|
290
|
+
Use `xray tls ech --serverName example.com` to generate usable ECH Server Key and corresponding Config. `example.com` is the SNI exposed externally when SNI is encrypted; you can fill in whatever you want. The Server Key contains ECHConfig. If you accidentally lose the Config used by the client, use `xray tls ech -i "your server key"` to retrieve it. You can publish it in the HTTPS record of DNS, refer to the format [here](https://dns.google/query?name=encryptedsni.com&rr_type=HTTPS) or RFC 9460.
|
|
291
|
+
|
|
292
|
+
Note that after configuring ECH, the server still accepts normal non-ECH connections.
|
|
293
|
+
|
|
294
|
+
> `echConfigList` : string
|
|
295
|
+
|
|
296
|
+
Client-only parameter. Configures ECHConfig. If not empty, it means the client enables Encrypted Client Hello. Supports two formats:
|
|
297
|
+
|
|
298
|
+
The first is a fixed ECHConfig string, e.g., `"AF7+DQBaAAAgACA51i3Ssu4wUMV4FNCc8iRX5J+YC4Bhigz9sacl2lCfSQAkAAEAAQABAAIAAQADAAIAAQACAAIAAgADAAMAAQADAAIAAwADAAtleGFtcGxlLmNvbQAA"`
|
|
299
|
+
|
|
300
|
+
The second is querying from a DNS server. For example, when using a CDN, you can dynamically obtain the configured ECHConfig via HTTPS records. If a valid ECH Config is obtained, Xray will respect the TTL issued by the server. The query target will be the configured SNI, or the configured server domain name (if SNI is empty and the target is a domain name).
|
|
301
|
+
|
|
302
|
+
The basic format is `"udp://1.1.1.1"`, indicating querying from UDP DNS 1.1.1.1. You can also use formats like `"https://1.1.1.1/dns-query"` (or `h2c://`), indicating querying via DOH (h2c) (replace with locally available servers for actual use). All three support modifying port numbers, e.g., `udp://1.1.1.1:53`. If omitted, defaults to 53/443 based on protocol.
|
|
303
|
+
|
|
304
|
+
Specifically, you can use a designated domain for querying ECHConfig, in the format `"example.com+https://1.1.1.1/dns-query"`. In this way, Xray will force the use of the ECHConfig in the DNS record of `example.com` for connection. This is useful if you want to get ECHConfig from DNS but don't want to expose yourself querying the HTTPS record of this domain or publishing HTTPS records under this domain.
|
|
305
|
+
|
|
306
|
+
> `echSockopt` : [SockoptObject](#sockoptobject)
|
|
307
|
+
|
|
308
|
+
Adjusts the underlying socket options of the connection used when querying ECH records using DNS.
|
|
309
|
+
|
|
310
|
+
### RealityObject
|
|
311
|
+
|
|
312
|
+
```json
|
|
313
|
+
{
|
|
314
|
+
"show": false,
|
|
315
|
+
"target": "example.com:443",
|
|
316
|
+
"xver": 0,
|
|
317
|
+
"serverNames": ["example.com", "www.example.com"],
|
|
318
|
+
"privateKey": "",
|
|
319
|
+
"minClientVer": "",
|
|
320
|
+
"maxClientVer": "",
|
|
321
|
+
"maxTimeDiff": 0,
|
|
322
|
+
"shortIds": ["", "0123456789abcdef"],
|
|
323
|
+
"mldsa65Seed": "",
|
|
324
|
+
"limitFallbackUpload": {
|
|
325
|
+
"afterBytes": 0,
|
|
326
|
+
"bytesPerSec": 0,
|
|
327
|
+
"burstBytesPerSec": 0
|
|
328
|
+
},
|
|
329
|
+
"limitFallbackDownload": {
|
|
330
|
+
"afterBytes": 0,
|
|
331
|
+
"bytesPerSec": 0,
|
|
332
|
+
"burstBytesPerSec": 0
|
|
333
|
+
},
|
|
334
|
+
"fingerprint": "chrome",
|
|
335
|
+
"serverName": "",
|
|
336
|
+
"password": "",
|
|
337
|
+
"shortId": "",
|
|
338
|
+
"mldsa65Verify": "",
|
|
339
|
+
"spiderX": ""
|
|
340
|
+
}
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
::: tip
|
|
344
|
+
For more information, please refer to the [REALITY Project](https://github.com/XTLS/REALITY).
|
|
345
|
+
:::
|
|
346
|
+
|
|
347
|
+
::: tip
|
|
348
|
+
Reality only modifies TLS. Client implementation only requires slight modification of fully random session IDs and custom certificate verification, theoretically fully compatible with most TLS combinations.
|
|
349
|
+
|
|
350
|
+
However, this does not apply to QUIC, because the session ID field that Reality needs to modify is entirely random in almost all TCP TLS implementations for compatibility purposes, but in QUIC TLS, this field has 0 length, leaving no room for modification.
|
|
351
|
+
:::
|
|
352
|
+
|
|
353
|
+
> `show` : true | false
|
|
354
|
+
|
|
355
|
+
When set to `true`, debug information is output.
|
|
356
|
+
|
|
357
|
+
::: tip
|
|
358
|
+
The following are **Inbound** (**Server-side**) configurations.
|
|
359
|
+
:::
|
|
360
|
+
|
|
361
|
+
> `target` : string
|
|
362
|
+
|
|
363
|
+
Required. Format same as VLESS `fallbacks` [dest](./features/fallback.md#fallbackobject).
|
|
364
|
+
|
|
365
|
+
Formerly named `dest`, both fields are aliases in the current version.
|
|
366
|
+
|
|
367
|
+
If `target` supports the post-quantum key exchange algorithm X25519MLKEM768, the Reality client will also automatically use this post-quantum algorithm for key negotiation. You can check support using `xray tls ping cloudflare.com` (change URL to dest, can include port).
|
|
368
|
+
|
|
369
|
+
The core distinguishes whether the current configuration is client or server based on the existence of this field. Do not fill it in on the client side, otherwise, it will cause identification errors.
|
|
370
|
+
|
|
371
|
+
::: warning
|
|
372
|
+
To ensure effective camouflage, Xray will **directly forward** traffic that fails authentication (non-legitimate Reality requests) to `target`.
|
|
373
|
+
If the IP address of the `target` website is special (e.g., websites using CloudFlare CDN), it is equivalent to your server acting as a port forwarder for CloudFlare, which may cause traffic theft after being scanned.
|
|
374
|
+
|
|
375
|
+
To prevent this, consider methods like fronting with Nginx to filter out SNIs that do not meet requirements.
|
|
376
|
+
Alternatively, consider configuring `limitFallbackUpload` and `limitFallbackDownload` to limit rates.
|
|
377
|
+
:::
|
|
378
|
+
|
|
379
|
+
> `xver` : number
|
|
380
|
+
|
|
381
|
+
Optional. Format same as VLESS `fallbacks` [xver](./features/fallback.md#fallbackobject).
|
|
382
|
+
|
|
383
|
+
> `serverNames` : \[string\]
|
|
384
|
+
|
|
385
|
+
Required. List of `serverNames` available to clients. `*` wildcard is not supported.
|
|
386
|
+
|
|
387
|
+
Generally consistent with `target`. Actual valid values are any SNI accepted by the server (depending on the configuration of `target` itself), usually referring to the [SAN](https://en.wikipedia.org/wiki/Subject_Alternative_Name) of the returned certificate.
|
|
388
|
+
|
|
389
|
+
Can contain empty value `""` representing acceptance of connections without SNI. Using this feature does not require `target` to have an IP certificate, just ensure it does not refuse connections upon receiving a Client Hello without SNI. When using this feature, the client `serverName` cannot be empty; it needs to be filled with any valid IP address as a placeholder.
|
|
390
|
+
|
|
391
|
+
You can use `xray tls ping` to observe the server's response behavior to requests without SNI.
|
|
392
|
+
|
|
393
|
+
> `privateKey` : string
|
|
394
|
+
|
|
395
|
+
Required. Execute `./xray x25519` to generate.
|
|
396
|
+
|
|
397
|
+
> `minClientVer` : string
|
|
398
|
+
|
|
399
|
+
Optional. Minimum Xray client version, format `x.y.z`.
|
|
400
|
+
|
|
401
|
+
> `maxClientVer` : string
|
|
402
|
+
|
|
403
|
+
Optional. Maximum Xray client version, format `x.y.z`.
|
|
404
|
+
|
|
405
|
+
> `maxTimeDiff` : number
|
|
406
|
+
|
|
407
|
+
Optional. Maximum allowed time difference in milliseconds.
|
|
408
|
+
|
|
409
|
+
> `shortIds` : \[string\]
|
|
410
|
+
|
|
411
|
+
Required. List of `shortIds` available to clients, used to distinguish different clients.
|
|
412
|
+
|
|
413
|
+
Format requirements see `shortId`.
|
|
414
|
+
|
|
415
|
+
If empty value is included, client `shortId` can be empty.
|
|
416
|
+
|
|
417
|
+
> `mldsa65Seed` : string
|
|
418
|
+
|
|
419
|
+
Server-only. Private key used to add extra post-quantum signatures to the certificate sent to the Reality client, using ML-DSA-65 (if a quantum computer capable of breaking x25519 exists, password leakage could allow MITM; this feature prevents such future attacks).
|
|
420
|
+
|
|
421
|
+
Use `xray mldsa65` to generate public-private key pairs. Configuring the private key on the server only adds it to certificate extensions, not affecting older clients or clients with this feature disabled.
|
|
422
|
+
|
|
423
|
+
Note: After configuring this feature, the length of the certificate returned by `target` **must** be greater than 3500, because post-quantum signatures cause the temporary certificate returned by Reality to become larger. To prevent creating a fingerprint, the certificate returned by `target` must also be large. You can check using `xray tls ping example.com`. Also, for perfect post-quantum security, `target` also needs to support post-quantum key exchange X25519MLKEM768; support can also be checked via the previous command.
|
|
424
|
+
|
|
425
|
+
> `limitFallbackUpload`/`limitFallbackDownload`
|
|
426
|
+
|
|
427
|
+
::: warning
|
|
428
|
+
Warning: For REALITY best practice, always steal certificates from the same ASN, so you probably won't use this feature; only when you are forced to steal certificates from free CDNs like Cloudflare, to avoid your server becoming an acceleration node for others, consider enabling this feature.
|
|
429
|
+
|
|
430
|
+
Fallback rate limiting is a fingerprint and is not recommended. If you are a panel/one-click script developer, be sure to randomize these parameters.
|
|
431
|
+
:::
|
|
432
|
+
|
|
433
|
+
::: tip
|
|
434
|
+
`limitFallbackUpload` and `limitFallbackDownload` are optional. They limit the speed of fallback connections that fail verification. `bytesPerSec` defaults to 0, meaning disabled.
|
|
435
|
+
|
|
436
|
+
Principle: For each unverified fallback connection, the rate limiting algorithm is enabled after transmitting `afterBytes` bytes.
|
|
437
|
+
Rate limiting uses a token bucket algorithm. The bucket capacity is `burstBytesPerSec`. Each byte transmitted consumes one token. Initial `burstBytesPerSec` is full.
|
|
438
|
+
The bucket is filled with `bytesPerSec` tokens every second until full.
|
|
439
|
+
|
|
440
|
+
Example: `afterBytes=10485760`, `burstBytesPerSec=5242880`, `bytesPerSec=1048576` means limiting speed to 1MB/s after transmitting 15MB. If transmission pauses, after 5 seconds it can burst to 5MB/s, then revert to 1MB/s.
|
|
441
|
+
|
|
442
|
+
Suggestion: Too large `afterBytes` and `burstBytesPerSec` will not be effective for rate limiting. Too small `bytesPerSec` and `burstBytesPerSec` are easy to detect.
|
|
443
|
+
Parameters should be set reasonably combined with the resource size of the stolen website. If burst is not allowed, `burstBytesPerSec` can be set to 0.
|
|
444
|
+
:::
|
|
445
|
+
|
|
446
|
+
> `afterBytes` : number
|
|
447
|
+
|
|
448
|
+
Optional. Limits the speed of fallback REALITY connections. Start limiting after transmitting specified bytes. Default is 0.
|
|
449
|
+
|
|
450
|
+
> `bytesPerSec` : number
|
|
451
|
+
|
|
452
|
+
Optional. Limits the speed of fallback REALITY connections. Base rate limit (bytes/second). Default 0 means rate limiting is disabled.
|
|
453
|
+
|
|
454
|
+
> `burstBytesPerSec` : number
|
|
455
|
+
|
|
456
|
+
Optional. Limits the speed of fallback REALITY connections. Burst rate limit (bytes/second). Effective when greater than `bytesPerSec`.
|
|
457
|
+
|
|
458
|
+
::: tip
|
|
459
|
+
The following are **Outbound** (**Client-side**) configurations.
|
|
460
|
+
:::
|
|
461
|
+
|
|
462
|
+
> `serverName` : string
|
|
463
|
+
|
|
464
|
+
One of the server `serverNames`.
|
|
465
|
+
|
|
466
|
+
Specifically, the client can set this to any IP address, and Xray will send a Client Hello without SNI extension. To use this feature, ensure server `serverNames` contains empty value `""`.
|
|
467
|
+
|
|
468
|
+
> `fingerprint` : string
|
|
469
|
+
|
|
470
|
+
Required. Same as [TLSObject](#tlsobject). Note: Using `unsafe` to disable uTLS is not supported here, because the REALITY protocol implementation uses this library to manipulate underlying TLS parameters.
|
|
471
|
+
|
|
472
|
+
> `shortId` : string
|
|
473
|
+
|
|
474
|
+
One of the server `shortIds`.
|
|
475
|
+
|
|
476
|
+
Length is 8 bytes, i.e., 16 hexadecimal characters (0~f). Can be less than 16; the core will automatically pad with 0s at the end, but the count must be **even** (since one byte has 2 hex digits).
|
|
477
|
+
|
|
478
|
+
E.g., `aa1234` will be auto-padded to `aa12340000000000`, but `aaa1234` will cause an error.
|
|
479
|
+
|
|
480
|
+
0 is also even, so if server `shortIds` contains empty value `""`, client can also be empty.
|
|
481
|
+
|
|
482
|
+
> `password` : string
|
|
483
|
+
|
|
484
|
+
Required. Public key corresponding to the server private key. Generated using `./xray x25519 -i "server private key"`. Formerly `publicKey`, renamed to prevent misunderstanding (this is indeed an x25519 public key in status, but in Reality design, it is held by the client and cannot be public).
|
|
485
|
+
|
|
486
|
+
> `mldsa65Verify`
|
|
487
|
+
|
|
488
|
+
Optional. Public key used for mldsa65 signature verification. When non-empty, use this public key to check the certificate returned by the server. See description of `"mldsa65Seed"` for details.
|
|
489
|
+
|
|
490
|
+
> `spiderX` : string
|
|
491
|
+
|
|
492
|
+
Initial path and parameters for the spider. It is recommended that each client be different.
|
|
493
|
+
|
|
494
|
+
#### CertificateObject
|
|
495
|
+
|
|
496
|
+
```json
|
|
497
|
+
{
|
|
498
|
+
"ocspStapling": 0,
|
|
499
|
+
"oneTimeLoading": false,
|
|
500
|
+
"usage": "encipherment",
|
|
501
|
+
"buildChain": false,
|
|
502
|
+
"certificateFile": "/path/to/certificate.crt",
|
|
503
|
+
"keyFile": "/path/to/key.key",
|
|
504
|
+
"certificate": [
|
|
505
|
+
"--BEGIN CERTIFICATE--",
|
|
506
|
+
"MIICwDCCAaigAwIBAgIRAO16JMdESAuHidFYJAR/7kAwDQYJKoZIhvcNAQELBQAw",
|
|
507
|
+
"ADAeFw0xODA0MTAxMzU1MTdaFw0xODA0MTAxNTU1MTdaMAAwggEiMA0GCSqGSIb3",
|
|
508
|
+
"DQEBAQUAA4IBDwAwggEKAoIBAQCs2PX0fFSCjOemmdm9UbOvcLctF94Ox4BpSfJ+",
|
|
509
|
+
"3lJHwZbvnOFuo56WhQJWrclKoImp/c9veL1J4Bbtam3sW3APkZVEK9UxRQ57HQuw",
|
|
510
|
+
"OzhV0FD20/0YELou85TwnkTw5l9GVCXT02NG+pGlYsFrxesUHpojdl8tIcn113M5",
|
|
511
|
+
"pypgDPVmPeeORRf7nseMC6GhvXYM4txJPyenohwegl8DZ6OE5FkSVR5wFQtAhbON",
|
|
512
|
+
"OAkIVVmw002K2J6pitPuJGOka9PxcCVWhko/W+JCGapcC7O74palwBUuXE1iH+Jp",
|
|
513
|
+
"noPjGp4qE2ognW3WH/sgQ+rvo20eXb9Um1steaYY8xlxgBsXAgMBAAGjNTAzMA4G",
|
|
514
|
+
"A1UdDwEB/wQEAwIFoDATBgNVHSUEDDAKBggrBgEFBQcDATAMBgNVHRMBAf8EAjAA",
|
|
515
|
+
"MA0GCSqGSIb3DQEBCwUAA4IBAQBUd9sGKYemzwPnxtw/vzkV8Q32NILEMlPVqeJU",
|
|
516
|
+
"7UxVgIODBV6A1b3tOUoktuhmgSSaQxjhYbFAVTD+LUglMUCxNbj56luBRlLLQWo+",
|
|
517
|
+
"9BUhC/ow393tLmqKcB59qNcwbZER6XT5POYwcaKM75QVqhCJVHJNb1zSEE7Co7iO",
|
|
518
|
+
"6wIan3lFyjBfYlBEz5vyRWQNIwKfdh5cK1yAu13xGENwmtlSTHiwbjBLXfk+0A/8",
|
|
519
|
+
"r/2s+sCYUkGZHhj8xY7bJ1zg0FRalP5LrqY+r6BckT1QPDIQKYy615j1LpOtwZe/",
|
|
520
|
+
"d4q7MD/dkzRDsch7t2cIjM/PYeMuzh87admSyL6hdtK0Nm/Q",
|
|
521
|
+
"--END CERTIFICATE--"
|
|
522
|
+
],
|
|
523
|
+
"key": [
|
|
524
|
+
"--BEGIN RSA PRIVATE KEY--",
|
|
525
|
+
"MIIEowIBAAKCAQEArNj19HxUgoznppnZvVGzr3C3LRfeDseAaUnyft5SR8GW75zh",
|
|
526
|
+
"bqOeloUCVq3JSqCJqf3Pb3i9SeAW7Wpt7FtwD5GVRCvVMUUOex0LsDs4VdBQ9tP9",
|
|
527
|
+
"GBC6LvOU8J5E8OZfRlQl09NjRvqRpWLBa8XrFB6aI3ZfLSHJ9ddzOacqYAz1Zj3n",
|
|
528
|
+
"jkUX+57HjAuhob12DOLcST8np6IcHoJfA2ejhORZElUecBULQIWzjTgJCFVZsNNN",
|
|
529
|
+
"itieqYrT7iRjpGvT8XAlVoZKP1viQhmqXAuzu+KWpcAVLlxNYh/iaZ6D4xqeKhNq",
|
|
530
|
+
"IJ1t1h/7IEPq76NtHl2/VJtbLXmmGPMZcYAbFwIDAQABAoIBAFCgG4phfGIxK9Uw",
|
|
531
|
+
"qrp+o9xQLYGhQnmOYb27OpwnRCYojSlT+mvLcqwvevnHsr9WxyA+PkZ3AYS2PLue",
|
|
532
|
+
"C4xW0pzQgdn8wENtPOX8lHkuBocw1rNsCwDwvIguIuliSjI8o3CAy+xVDFgNhWap",
|
|
533
|
+
"/CMzfQYziB7GlnrM6hH838iiy0dlv4I/HKk+3/YlSYQEvnFokTf7HxbDDmznkJTM",
|
|
534
|
+
"aPKZ5qbnV+4AcQfcLYJ8QE0ViJ8dVZ7RLwIf7+SG0b0bqloti4+oQXqGtiESUwEW",
|
|
535
|
+
"/Wzi7oyCbFJoPsFWp1P5+wD7jAGpAd9lPIwPahdr1wl6VwIx9W0XYjoZn71AEaw4",
|
|
536
|
+
"bK4xUXECgYEA3g2o9WqyrhYSax3pGEdvV2qN0VQhw7Xe+jyy98CELOO2DNbB9QNJ",
|
|
537
|
+
"8cSSU/PjkxQlgbOJc8DEprdMldN5xI/srlsbQWCj72wXxXnVnh991bI2clwt7oYi",
|
|
538
|
+
"pcGZwzCrJyFL+QaZmYzLxkxYl1tCiiuqLm+EkjxCWKTX/kKEFb6rtnMCgYEAx0WR",
|
|
539
|
+
"L8Uue3lXxhXRdBS5QRTBNklkSxtU+2yyXRpvFa7Qam+GghJs5RKfJ9lTvjfM/PxG",
|
|
540
|
+
"3vhuBliWQOKQbm1ZGLbgGBM505EOP7DikUmH/kzKxIeRo4l64mioKdDwK/4CZtS7",
|
|
541
|
+
"az0Lq3eS6bq11qL4mEdE6Gn/Y+sqB83GHZYju80CgYABFm4KbbBcW+1RKv9WSBtK",
|
|
542
|
+
"gVIagV/89moWLa/uuLmtApyEqZSfn5mAHqdc0+f8c2/Pl9KHh50u99zfKv8AsHfH",
|
|
543
|
+
"TtjuVAvZg10GcZdTQ/I41ruficYL0gpfZ3haVWWxNl+J47di4iapXPxeGWtVA+u8",
|
|
544
|
+
"eH1cvgDRMFWCgE7nUFzE8wKBgGndUomfZtdgGrp4ouLZk6W4ogD2MpsYNSixkXyW",
|
|
545
|
+
"64cIbV7uSvZVVZbJMtaXxb6bpIKOgBQ6xTEH5SMpenPAEgJoPVts816rhHdfwK5Q",
|
|
546
|
+
"8zetklegckYAZtFbqmM0xjOI6bu5rqwFLWr1xo33jF0wDYPQ8RHMJkruB1FIB8V2",
|
|
547
|
+
"GxvNAoGBAM4g2z8NTPMqX+8IBGkGgqmcYuRQxd3cs7LOSEjF9hPy1it2ZFe/yUKq",
|
|
548
|
+
"ePa2E8osffK5LBkFzhyQb0WrGC9ijM9E6rv10gyuNjlwXdFJcdqVamxwPUBtxRJR",
|
|
549
|
+
"cYTY2HRkJXDdtT0Bkc3josE6UUDvwMpO0CfAETQPto1tjNEDhQhT",
|
|
550
|
+
"--END RSA PRIVATE KEY--"
|
|
551
|
+
]
|
|
552
|
+
}
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
Server certificate, hot reloaded every 3600 seconds (i.e., one hour).
|
|
556
|
+
|
|
557
|
+
> `ocspStapling`: number
|
|
558
|
+
|
|
559
|
+
OCSP stapling update interval in seconds, default is 0. Any non-zero value enables OCSP stapling and overrides the default 3600-second certificate hot reload time (executes OCSP stapling while reloading).
|
|
560
|
+
|
|
561
|
+
> `oneTimeLoading`: true | false
|
|
562
|
+
|
|
563
|
+
Load only once, default `false`. When set to `true`, certificate hot reloading and OCSP stapling are disabled.
|
|
564
|
+
|
|
565
|
+
> `usage`: "encipherment" | "verify" | "issue"
|
|
566
|
+
|
|
567
|
+
Certificate usage, default value is `"encipherment"`.
|
|
568
|
+
|
|
569
|
+
- `"encipherment"`: Certificate is used for TLS authentication and encryption.
|
|
570
|
+
- `"verify"`: Certificate is used to verify remote TLS certificates. When using this item, the current certificate must be a CA certificate.
|
|
571
|
+
- `"issue"`: Certificate is used to issue other certificates. When using this item, the current certificate must be a CA certificate.
|
|
572
|
+
|
|
573
|
+
::: tip TIP 1
|
|
574
|
+
On Windows platforms, self-signed CA certificates can be installed into the system to verify remote TLS certificates.
|
|
575
|
+
:::
|
|
576
|
+
|
|
577
|
+
::: tip TIP 2
|
|
578
|
+
When there is a new client request, assuming the specified `serverName` is `"xray.com"`, Xray will first look for a valid certificate for `"xray.com"` in the certificate list. If not found, it will use any certificate with `usage` `"issue"` to issue a certificate valid for `"xray.com"` with a validity period of one hour. The new certificate is added to the certificate list for future use.
|
|
579
|
+
:::
|
|
580
|
+
|
|
581
|
+
::: tip TIP 3
|
|
582
|
+
When both `certificateFile` and `certificate` are specified, Xray prefers `certificateFile`. Same for `keyFile` and `key`.
|
|
583
|
+
:::
|
|
584
|
+
|
|
585
|
+
::: tip TIP 4
|
|
586
|
+
When `usage` is `"verify"`, `keyFile` and `key` can both be empty.
|
|
587
|
+
:::
|
|
588
|
+
|
|
589
|
+
::: tip TIP 5
|
|
590
|
+
Use `xray tls cert` to generate self-signed CA certificates.
|
|
591
|
+
:::
|
|
592
|
+
|
|
593
|
+
::: tip TIP 6
|
|
594
|
+
If you already own a domain, you can use tools like [acme.sh](https://github.com/acmesh-official/acme.sh) to easily get free third-party certificates.
|
|
595
|
+
:::
|
|
596
|
+
|
|
597
|
+
> `buildChain`: true | false
|
|
598
|
+
|
|
599
|
+
Only effective when certificate usage is `issue`. If `true`, embed the CA certificate into the certificate chain when issuing certificates.
|
|
600
|
+
|
|
601
|
+
::: tip TIP 1
|
|
602
|
+
Root certificates should not be embedded in the certificate chain. This option is only suitable when the signing CA certificate is an intermediate certificate.
|
|
603
|
+
:::
|
|
604
|
+
|
|
605
|
+
> `certificateFile`: string
|
|
606
|
+
|
|
607
|
+
Certificate file path. If generated using OpenSSL, extension is .crt.
|
|
608
|
+
|
|
609
|
+
> `certificate`: \[ string \]
|
|
610
|
+
|
|
611
|
+
An array of strings representing certificate content, format as shown in the example. Choose one between `certificate` and `certificateFile`.
|
|
612
|
+
|
|
613
|
+
> `keyFile`: string
|
|
614
|
+
|
|
615
|
+
Key file path. If generated using OpenSSL, extension is .key. Password-protected key files are not supported currently.
|
|
616
|
+
|
|
617
|
+
> `key`: \[ string \]
|
|
618
|
+
|
|
619
|
+
An array of strings representing key content, format as shown in the example. Choose one between `key` and `keyFile`.
|
|
620
|
+
|
|
621
|
+
### SockoptObject
|
|
622
|
+
|
|
623
|
+
```json
|
|
624
|
+
{
|
|
625
|
+
"mark": 0,
|
|
626
|
+
"tcpMaxSeg": 1440,
|
|
627
|
+
"tcpFastOpen": false,
|
|
628
|
+
"tproxy": "off",
|
|
629
|
+
"domainStrategy": "AsIs",
|
|
630
|
+
"happyEyeballs": {},
|
|
631
|
+
"dialerProxy": "",
|
|
632
|
+
"acceptProxyProtocol": false,
|
|
633
|
+
"tcpKeepAliveInterval": 0,
|
|
634
|
+
"tcpKeepAliveIdle": 300,
|
|
635
|
+
"tcpUserTimeout": 10000,
|
|
636
|
+
"tcpcongestion": "bbr",
|
|
637
|
+
"interface": "wg0",
|
|
638
|
+
"V6Only": false,
|
|
639
|
+
"tcpWindowClamp": 600,
|
|
640
|
+
"tcpMptcp": false,
|
|
641
|
+
"addressPortStrategy": "",
|
|
642
|
+
"customSockopt": []
|
|
643
|
+
}
|
|
644
|
+
```
|
|
645
|
+
|
|
646
|
+
> `mark`: number
|
|
647
|
+
|
|
648
|
+
An integer. When non-zero, mark the outbound connection with this value using SO_MARK.
|
|
649
|
+
|
|
650
|
+
- Only applies to Linux systems.
|
|
651
|
+
- Requires CAP_NET_ADMIN permission.
|
|
652
|
+
|
|
653
|
+
> `tcpMaxSeg`: number
|
|
654
|
+
|
|
655
|
+
Used to set the Maximum Segment Size (MSS) for TCP packets.
|
|
656
|
+
|
|
657
|
+
> `tcpFastOpen`: true | false | number
|
|
658
|
+
|
|
659
|
+
Whether to enable [TCP Fast Open](https://en.wikipedia.org/wiki/TCP_Fast_Open).
|
|
660
|
+
|
|
661
|
+
When set to `true` or a `positive integer`, TFO is enabled; when `false` or `negative`, TFO is forced disabled; when absent or `0`, system default is used. Can be used for inbound/outbound.
|
|
662
|
+
|
|
663
|
+
- Only available in the following (or newer) OS versions:
|
|
664
|
+
- Linux 3.16: Requires setting kernel parameter `net.ipv4.tcp_fastopen`. This parameter is a bitmap: `0x1` allows client to enable, `0x2` allows server to enable; default is `0x1`. If server needs to enable TFO, set this to `0x3`.
|
|
665
|
+
- ~~Windows 10 (1607)~~ (Implementation incorrect)
|
|
666
|
+
- Mac OS 10.11 / iOS 9 (Needs testing)
|
|
667
|
+
- FreeBSD 10.3 (Server) / 12.0 (Client): Requires kernel parameters `net.inet.tcp.fastopen.server_enabled` and `net.inet.tcp.fastopen.client_enabled` set to `1`. (Needs testing)
|
|
668
|
+
|
|
669
|
+
- For Inbound, the `positive integer` set here represents the [limit of pending TFO connection requests](https://tools.ietf.org/html/rfc7413#section-5.1). **Note: Not all OSs support setting this here**:
|
|
670
|
+
- Linux / FreeBSD: The `positive integer` here represents the limit. Max acceptable value is 2147483647. If `true`, it takes `256`. Note on Linux, `net.core.somaxconn` limits this value. If exceeding `somaxconn`, increase `somaxconn` as well.
|
|
671
|
+
- Mac OS: `true` or `positive integer` only enables TFO. The limit needs to be set via kernel parameter `net.inet.tcp.fastopen_backlog`.
|
|
672
|
+
- Windows: `true` or `positive integer` only enables TFO.
|
|
673
|
+
|
|
674
|
+
- For Outbound, setting to `true` or `positive integer` only enables TFO on any OS.
|
|
675
|
+
|
|
676
|
+
> `tproxy`: "redirect" | "tproxy" | "off"
|
|
677
|
+
|
|
678
|
+
Whether to enable transparent proxy (Linux only).
|
|
679
|
+
|
|
680
|
+
- `"redirect"`: Use Redirect mode transparent proxy. Supports all IPv4/6 TCP connections.
|
|
681
|
+
- `"tproxy"`: Use TProxy mode transparent proxy. Supports all IPv4/6 TCP and UDP connections.
|
|
682
|
+
- `"off"`: Disable transparent proxy.
|
|
683
|
+
|
|
684
|
+
Transparent proxy requires Root or `CAP_NET_ADMIN` permission.
|
|
685
|
+
|
|
686
|
+
::: danger
|
|
687
|
+
When `followRedirect` is `true` in [Dokodemo-door](./inbounds/tunnel.md), and `tproxy` in Sockopt settings is empty, the value of `tproxy` in Sockopt settings will be set to `"redirect"`.
|
|
688
|
+
:::
|
|
689
|
+
|
|
690
|
+
> `domainStrategy`: "AsIs"<br>
|
|
691
|
+
> "UseIP" | "UseIPv6v4" | "UseIPv6" | "UseIPv4v6" | "UseIPv4"<br>
|
|
692
|
+
> "ForceIP" | "ForceIPv6v4" | "ForceIPv6" | "ForceIPv4v6" | "ForceIPv4"
|
|
693
|
+
|
|
694
|
+
Default value `"AsIs"`.
|
|
695
|
+
|
|
696
|
+
When the target address is a domain name, configure the value to control the Outbound connection behavior:
|
|
697
|
+
|
|
698
|
+
- `"AsIs"`: Xray does no special handling of domains. Finally, Xray uses Go's built-in Dial to initiate connection. Priority is fixed to RFC6724 default (will not follow gai.conf etc.), usually IPv6 preferred.
|
|
699
|
+
- Other values: Use Xray-core [Built-in DNS Server](dns.md) for resolution. If no DNSObject exists, system DNS is used. If multiple IPs match, the core randomly selects one as the target IP.
|
|
700
|
+
- `"IPv4"`: Attempt to connect using only IPv4.
|
|
701
|
+
- `"IPv4v6"`: Attempt to connect using IPv4 or IPv6, but use IPv4 for dual-stack domains. (v4v6 swapped is analogous).
|
|
702
|
+
- When `"queryStrategy"` is set in built-in DNS, actual behavior intersects with this option. Only IP types included in both will be resolved. E.g., `"queryStrategy": "UseIPv4"` + `"domainStrategy": "UseIP"` is effectively `"domainStrategy": "UseIPv4"`.
|
|
703
|
+
- `"Use"` prefix: If resolution result doesn't meet requirements (e.g., domain only has IPv4 but used UseIPv6), fallback to AsIs.
|
|
704
|
+
- `"Force"` prefix: If resolution result doesn't meet requirements, connection fails.
|
|
705
|
+
|
|
706
|
+
::: tip TIP
|
|
707
|
+
When using `"UseIP"` or `"ForceIP"` modes, and `sendThrough` is specified in [Outbound Connection Configuration](outbound.md#outboundobject), the core automatically judges required IP type (IPv4 or IPv6) based on `sendThrough`. If a single IP type is manually specified (e.g., UseIPv4) but mismatches `sendThrough` local address, connection fails.
|
|
708
|
+
:::
|
|
709
|
+
|
|
710
|
+
::: danger
|
|
711
|
+
Enabling this feature with improper configuration may cause infinite loops.
|
|
712
|
+
|
|
713
|
+
TL;DR: Connecting to server requires waiting for DNS result; finishing DNS query requires connecting to server.
|
|
714
|
+
|
|
715
|
+
> Tony: Chicken or egg first?
|
|
716
|
+
|
|
717
|
+
Detailed explanation:
|
|
718
|
+
|
|
719
|
+
1. Trigger: Proxy server (`proxy.com`). Built-in DNS server, non-Local mode.
|
|
720
|
+
2. Xray attempts to establish TCP connection to `proxy.com`. **Before** that, query `proxy.com` via built-in DNS.
|
|
721
|
+
3. Built-in DNS connects to `dns.com` to query IP of `proxy.com`.
|
|
722
|
+
4. **Improper** routing rules cause `proxy.com` to proxy the query sent in step 3.
|
|
723
|
+
5. Xray attempts to establish another TCP connection to `proxy.com`.
|
|
724
|
+
6. Before establishing, query `proxy.com` via built-in DNS.
|
|
725
|
+
7. Built-in DNS reuses connection from step 3 to send query.
|
|
726
|
+
8. Problem: Connection in step 3 waits for query result in step 7; query in step 7 waits for connection in step 3 to fully establish.
|
|
727
|
+
9. Good Game!
|
|
728
|
+
|
|
729
|
+
Solutions:
|
|
730
|
+
|
|
731
|
+
- Change traffic splitting for built-in DNS server.
|
|
732
|
+
- Use Hosts.
|
|
733
|
+
- ~~If you still don't know the solution, don't use this feature.~~
|
|
734
|
+
|
|
735
|
+
Therefore, inexperienced users are **not recommended** to use this feature unauthorized.
|
|
736
|
+
:::
|
|
737
|
+
|
|
738
|
+
> `dialerProxy`: ""
|
|
739
|
+
|
|
740
|
+
An outbound proxy identifier. When not empty, connection is made using specified outbound. Used for chain forwarding supporting underlying transports.
|
|
741
|
+
|
|
742
|
+
::: danger
|
|
743
|
+
Incompatible with ProxySettingsObject.Tag.
|
|
744
|
+
:::
|
|
745
|
+
|
|
746
|
+
> `acceptProxyProtocol`: true | false
|
|
747
|
+
|
|
748
|
+
Inbound only. Indicates whether to accept PROXY protocol.
|
|
749
|
+
|
|
750
|
+
[PROXY protocol](https://www.haproxy.org/download/2.2/doc/proxy-protocol.txt) is for passing real source IP and port. **Ignore if you don't understand it**.
|
|
751
|
+
|
|
752
|
+
Common reverse proxies (HAProxy, Nginx) can be configured to send it. VLESS fallbacks xver can also send it.
|
|
753
|
+
|
|
754
|
+
When `true`, requester must send PROXY protocol v1 or v2 after bottom-layer TCP establishment, otherwise connection closes.
|
|
755
|
+
|
|
756
|
+
> `tcpKeepAliveIdle`: number
|
|
757
|
+
|
|
758
|
+
TCP idle time threshold in seconds. Keep-Alive probes start after connection is idle for this duration.
|
|
759
|
+
|
|
760
|
+
For outbound, Xray uses Chrome defaults (idle & interval both 45s). Setting this or `tcpKeepAliveInterval` to negative disables default keepalive; positive overrides default.
|
|
761
|
+
|
|
762
|
+
For inbound, Keep-Alive is disabled by default. Enabled if either this or `tcpKeepAliveInterval` is non-zero. If only one is set, the other follows OS settings.
|
|
763
|
+
|
|
764
|
+
> `tcpKeepAliveInterval`: number
|
|
765
|
+
|
|
766
|
+
Interval between Keep-Alive packets in seconds after TCP enters Keep-Alive state. See above for behavior.
|
|
767
|
+
|
|
768
|
+
> `tcpUserTimeout`: number
|
|
769
|
+
|
|
770
|
+
In milliseconds. Details: https://github.com/grpc/proposal/blob/master/A18-tcp-user-timeout.md
|
|
771
|
+
|
|
772
|
+
> `tcpcongestion`: ""
|
|
773
|
+
|
|
774
|
+
TCP congestion control algorithm. Linux only.
|
|
775
|
+
Not configuring means using system default.
|
|
776
|
+
|
|
777
|
+
::: tip Common Algorithms
|
|
778
|
+
|
|
779
|
+
- bbr (Recommended)
|
|
780
|
+
- cubic
|
|
781
|
+
- reno
|
|
782
|
+
:::
|
|
783
|
+
|
|
784
|
+
::: tip
|
|
785
|
+
Run `sysctl net.ipv4.tcp_congestion_control` to get system default.
|
|
786
|
+
:::
|
|
787
|
+
|
|
788
|
+
> `interface`: ""
|
|
789
|
+
|
|
790
|
+
Bind outbound network interface name. Supports Linux / iOS / Mac OS / Windows.
|
|
791
|
+
|
|
792
|
+
> `V6Only`: true | false
|
|
793
|
+
|
|
794
|
+
When `true`, listening on `::` only accepts IPv6 connections. Linux only.
|
|
795
|
+
|
|
796
|
+
> `tcpWindowClamp`: number
|
|
797
|
+
|
|
798
|
+
Bind advertised window size to this value. Kernel picks max between this and SOCK_MIN_RCVBUF/2.
|
|
799
|
+
|
|
800
|
+
> `tcpMptcp`: true | false
|
|
801
|
+
|
|
802
|
+
Default `false`. When `true`, enables [Multipath TCP](https://en.wikipedia.org/wiki/Multipath_TCP). Client-only parameter, as golang 1.24+ enables MPTCP by default on listen.
|
|
803
|
+
Currently only supports Linux, requires Kernel 5.6+.
|
|
804
|
+
|
|
805
|
+
> `tcpNoDelay`: true | false
|
|
806
|
+
|
|
807
|
+
Option removed as golang enables TCP no delay by default. To disable, use customSockopt.
|
|
808
|
+
|
|
809
|
+
> `addressPortStrategy`: "none" | "SrvPortOnly" | "SrvAddressOnly" | "SrvPortAndAddress" | "TxtPortOnly" | "TxtAddressOnly" | "TxtPortAndAddress"
|
|
810
|
+
|
|
811
|
+
Use SRV or TXT records to specify target address/port for outbound. Default `none` (off).
|
|
812
|
+
|
|
813
|
+
Query goes through system DNS, not Xray built-in DNS. Domain queried is the outbound domain. If query fails, request proceeds with original address/port.
|
|
814
|
+
|
|
815
|
+
`Srv` prefix: Query SRV record (standard format). `Txt` prefix: Query TXT record (format like `127.0.0.1:80`).
|
|
816
|
+
|
|
817
|
+
`PortOnly`: Reset port only. `AddressOnly`: Reset address only. `PortAndAddress`: Reset both.
|
|
818
|
+
|
|
819
|
+
Effective before sockopt `domainStrategy` resolution. After reset, still resolves per `domainStrategy` (if any), but ineffective if Freedom `domainStrategy` is set to resolve to IP beforehand.
|
|
820
|
+
|
|
821
|
+
PS: If normal domain traffic comes to AsIs Freedom outbound, it attempts resolution and reset here. E.g., core queries SRV record for google.com and resets target accordingly.
|
|
822
|
+
|
|
823
|
+
> `customSockopt`: []
|
|
824
|
+
|
|
825
|
+
Array for advanced users to specify any sockopt. Theoretically covers all connection settings. Supports Linux, Windows, Darwin. Example equivalent to `"tcpcongestion": "bbr"`:
|
|
826
|
+
|
|
827
|
+
Ensure you understand Socket programming.
|
|
828
|
+
|
|
829
|
+
```json
|
|
830
|
+
"customSockopt": [
|
|
831
|
+
{
|
|
832
|
+
"system": "linux",
|
|
833
|
+
"type": "str",
|
|
834
|
+
"level":"6",
|
|
835
|
+
"opt": "13",
|
|
836
|
+
"value": "bbr"
|
|
837
|
+
}
|
|
838
|
+
]
|
|
839
|
+
```
|
|
840
|
+
|
|
841
|
+
> `system`: ""
|
|
842
|
+
|
|
843
|
+
Optional. Target system. Skipped if mismatch. Options: `linux`, `windows`, `darwin` (lowercase). Executes if empty.
|
|
844
|
+
|
|
845
|
+
> `type`: ""
|
|
846
|
+
|
|
847
|
+
Required. Type, `int` or `str`.
|
|
848
|
+
|
|
849
|
+
> `level`: ""
|
|
850
|
+
|
|
851
|
+
Optional. Protocol level. Default 6 (TCP).
|
|
852
|
+
|
|
853
|
+
> `opt`: ""
|
|
854
|
+
|
|
855
|
+
Option name in decimal (Example TCP_CONGESTION 0xd is 13).
|
|
856
|
+
|
|
857
|
+
> `value`: ""
|
|
858
|
+
|
|
859
|
+
Value to set. Example sets bbr.
|
|
860
|
+
Use decimal number if type is int.
|
|
861
|
+
|
|
862
|
+
> `happyEyeballs`: [HappyEyeballsObject](#happyeyeballsobject)
|
|
863
|
+
|
|
864
|
+
RFC-8305 Happy Eyeballs implementation, TCP only. Races target domains and selects first success. Only effective when `Sockopt.domainStrategy` is not `AsIs`.
|
|
865
|
+
|
|
866
|
+
Note: `UseIPv4v6` / `ForceIPv4v6` reduces available IPs to IPv4 only, falling back to IPv6 query only on failure. Not recommended. Suggest `UseIP` / `ForceIP` with `HappyEyeballs.interleave`.
|
|
867
|
+
|
|
868
|
+
::: warning
|
|
869
|
+
Do not use `Freedom` outbound's `domainStrategy` with this, as `Sockopt` will only see the replaced IP.
|
|
870
|
+
:::
|
|
871
|
+
|
|
872
|
+
#### HappyEyeballsObject
|
|
873
|
+
|
|
874
|
+
```json
|
|
875
|
+
"happyEyeballs": {
|
|
876
|
+
"tryDelayMs": 250,
|
|
877
|
+
"prioritizeIPv6": false,
|
|
878
|
+
"interleave": 1,
|
|
879
|
+
"maxConcurrentTry": 4
|
|
880
|
+
}
|
|
881
|
+
```
|
|
882
|
+
|
|
883
|
+
> `tryDelayMs`: number
|
|
884
|
+
|
|
885
|
+
Interval between race requests in ms. Default 0 (disabled). Recommended 250.
|
|
886
|
+
|
|
887
|
+
> `prioritizeIPv6`: bool
|
|
888
|
+
|
|
889
|
+
Whether first IP is IPv6 when sorting. Default `false` (IPv4 first).
|
|
890
|
+
|
|
891
|
+
> `interleave`: number
|
|
892
|
+
|
|
893
|
+
"First Address Family count" in RFC-8305. Default 1. Defines interleaving behavior for sorting IP versions.
|
|
894
|
+
|
|
895
|
+
E.g., waiting IP queue sorted as 46464646 (set to 1), 44664466 (set to 2).
|
|
896
|
+
|
|
897
|
+
> `maxConcurrentTry`: number
|
|
898
|
+
|
|
899
|
+
Max concurrent attempts. Prevents core from making massive connections if many IPs resolve but fail. Default 4. Set to 0 to disable happyEyeballs.
|
|
900
|
+
|
|
901
|
+
### FinalMaskObject
|
|
902
|
+
|
|
903
|
+
FinalMask applies a final layer of obfuscation to the traffic after the core has processed transport layer encryption, including TLS/REALITY. Currently, only UDP is supported.
|
|
904
|
+
|
|
905
|
+
```json
|
|
906
|
+
{
|
|
907
|
+
"tcp": [
|
|
908
|
+
{
|
|
909
|
+
"type": "",
|
|
910
|
+
"settings": {}
|
|
911
|
+
}
|
|
912
|
+
],
|
|
913
|
+
"udp": [
|
|
914
|
+
{
|
|
915
|
+
"type": "",
|
|
916
|
+
"settings": {}
|
|
917
|
+
}
|
|
918
|
+
],
|
|
919
|
+
"quicParams": {
|
|
920
|
+
"congestion": "force-brutal",
|
|
921
|
+
"debug": false,
|
|
922
|
+
"brutalUp": "60 mbps",
|
|
923
|
+
"brutalDown": 0,
|
|
924
|
+
"udpHop": {
|
|
925
|
+
"ports": "20000-50000",
|
|
926
|
+
"interval": "5-10"
|
|
927
|
+
},
|
|
928
|
+
"initStreamReceiveWindow": 8388608,
|
|
929
|
+
"maxStreamReceiveWindow": 8388608,
|
|
930
|
+
"initConnectionReceiveWindow": 20971520,
|
|
931
|
+
"maxConnectionReceiveWindow": 20971520,
|
|
932
|
+
"maxIdleTimeout": 30,
|
|
933
|
+
"keepAlivePeriod": 0,
|
|
934
|
+
"disablePathMTUDiscovery": false,
|
|
935
|
+
"maxIncomingStreams": 1024
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
```
|
|
939
|
+
|
|
940
|
+
> `tcp[n].type`: header-custom | fragment | sudoku
|
|
941
|
+
|
|
942
|
+
The first element in the array is the outermost camouflage.
|
|
943
|
+
|
|
944
|
+
Used in conjunction with raw | httpupgarde | websocket | gRPC | xhttp transport layers.
|
|
945
|
+
|
|
946
|
+
`header-custom`:
|
|
947
|
+
|
|
948
|
+
`fragment`:
|
|
949
|
+
|
|
950
|
+
`sudoku`:
|
|
951
|
+
|
|
952
|
+
> `tcp[n].settings`: header-custom | fragment | sudoku
|
|
953
|
+
|
|
954
|
+
#### header-custom
|
|
955
|
+
|
|
956
|
+
```json
|
|
957
|
+
{
|
|
958
|
+
"clients": [
|
|
959
|
+
[
|
|
960
|
+
{
|
|
961
|
+
"delay": 0,
|
|
962
|
+
"rand": 0,
|
|
963
|
+
"randRange": "0-255",
|
|
964
|
+
"type": "",
|
|
965
|
+
"packet": []
|
|
966
|
+
}
|
|
967
|
+
]
|
|
968
|
+
],
|
|
969
|
+
"servers": [
|
|
970
|
+
[
|
|
971
|
+
{
|
|
972
|
+
"delay": 0,
|
|
973
|
+
"rand": 0,
|
|
974
|
+
"randRange": "0-255",
|
|
975
|
+
"type": "",
|
|
976
|
+
"packet": []
|
|
977
|
+
}
|
|
978
|
+
]
|
|
979
|
+
],
|
|
980
|
+
"errors": [
|
|
981
|
+
[
|
|
982
|
+
{
|
|
983
|
+
"delay": 0,
|
|
984
|
+
"rand": 0,
|
|
985
|
+
"randRange": "0-255",
|
|
986
|
+
"type": "",
|
|
987
|
+
"packet": []
|
|
988
|
+
}
|
|
989
|
+
]
|
|
990
|
+
]
|
|
991
|
+
}
|
|
992
|
+
```
|
|
993
|
+
|
|
994
|
+
`clients[n][m].delay`: The unit is milliseconds; a value of 0 indicates that the packet was previously sent in a fragmented manner.
|
|
995
|
+
|
|
996
|
+
`clients[n][m].rand`: Adds a specified length of random bytes, which conflicts with `packet`.
|
|
997
|
+
|
|
998
|
+
`clients[n][m].randRange`: Random byte range, default 0-255.
|
|
999
|
+
|
|
1000
|
+
`clients[n][m].type`: The `packet` type can be `array | str | hex | base64`, with the default being array.
|
|
1001
|
+
|
|
1002
|
+
`clients[n][m].packet`: Adding fixed data conflicts with `rand`.
|
|
1003
|
+
|
|
1004
|
+
#### fragment
|
|
1005
|
+
|
|
1006
|
+
```json
|
|
1007
|
+
{
|
|
1008
|
+
"packets": "tlshello",
|
|
1009
|
+
"length": "100-200",
|
|
1010
|
+
"delay": "10-20",
|
|
1011
|
+
"maxSplit": "3-6"
|
|
1012
|
+
}
|
|
1013
|
+
```
|
|
1014
|
+
|
|
1015
|
+
#### sudoku
|
|
1016
|
+
|
|
1017
|
+
```json
|
|
1018
|
+
{
|
|
1019
|
+
"password": "",
|
|
1020
|
+
"ascii": "",
|
|
1021
|
+
|
|
1022
|
+
"customTable": "", // custom_table in official docs
|
|
1023
|
+
"customTables": [""], // custom_tables in official docs
|
|
1024
|
+
|
|
1025
|
+
"paddingMin": 0, // padding_min in official docs
|
|
1026
|
+
"paddingMax": 0 // padding_max in official docs
|
|
1027
|
+
}
|
|
1028
|
+
```
|
|
1029
|
+
|
|
1030
|
+
See [official documentation](https://github.com/SUDOKU-ASCII/sudoku/blob/main/configs/README.md) for field descriptions.
|
|
1031
|
+
|
|
1032
|
+
> `udp[n].type`: header-custom | header-dns | header-dtls | header-srtp | header-utp | header-wechat | header-wireguard | mkcp-original | mkcp-aes128gcm | noise | salamander | sudoku | xdns | xicmp
|
|
1033
|
+
|
|
1034
|
+
The first element in the array is the outermost camouflage.
|
|
1035
|
+
|
|
1036
|
+
Used in conjunction with raw udp | kcp | hysteria | xhttp h3 transport layers.
|
|
1037
|
+
|
|
1038
|
+
`header-custom`: Always merge packets into the data packet header.
|
|
1039
|
+
|
|
1040
|
+
`header-dns`: Original mKCP DNS obfuscation. Some campus networks allow DNS queries without login, add DNS header to KCP.
|
|
1041
|
+
|
|
1042
|
+
`header-dtls`: Original mKCP DTLS obfuscation. Obfuscates as DTLS 1.2 packets. No additional configuration required.
|
|
1043
|
+
|
|
1044
|
+
`header-srtp`: Original mKCP SRTP obfuscation. Obfuscates as SRTP packets, will be recognized as video call data (e.g., FaceTime). No additional configuration required.
|
|
1045
|
+
|
|
1046
|
+
`header-utp`: Original mKCP uTP obfuscation. Obfuscates as uTP packets, will be recognized as BT download data. No additional configuration required.
|
|
1047
|
+
|
|
1048
|
+
`header-wechat`: Original mKCP WeChat Video obfuscation. Obfuscates as WeChat video call data. No additional configuration required.
|
|
1049
|
+
|
|
1050
|
+
`header-wireguard`: Original mKCP WireGuard obfuscation. Obfuscates as WireGuard packets. (Not the real WireGuard protocol) No additional configuration required.
|
|
1051
|
+
|
|
1052
|
+
`mkcp-original`: The simple obfuscation that was previously applied by default in mKCP. You may need to configure this to connect to legacy mKCP servers. No additional configuration required.
|
|
1053
|
+
|
|
1054
|
+
`mkcp-aes128gcm`: Corresponds to the original mKCP `seed` feature. Uses AES-128-GCM for obfuscation.
|
|
1055
|
+
|
|
1056
|
+
`noise`: Noise sent before data is transmitted.
|
|
1057
|
+
|
|
1058
|
+
`salamander`: Salamander obfuscation (from Hysteria2).
|
|
1059
|
+
|
|
1060
|
+
`sudoku`:
|
|
1061
|
+
|
|
1062
|
+
`xdns`: Utilizes DNS queries to transport data (similar to DNSTT). It performs standard DNS TXT queries to transport the payload. Due to technical limitations, the resulting MTU is very small, making it incompatible with QUIC; it is recommended to use it with mKCP. Recommended MTU values: Client 130, Server 900.
|
|
1063
|
+
|
|
1064
|
+
`domain` is the domain name used for queries. Since the queries performed are standard, they can be forwarded through any UDP DNS server, although efficiency may be very suboptimal. To use this feature, the server needs to listen on port 53, and the proxy protocol should direct the target to a DNS server (e.g., 8.8.8.8:53). Additionally, you must own the domain specified in `domain` and point its NS record to your server.
|
|
1065
|
+
|
|
1066
|
+
For example, if you own example.com, then you can set an A record for a.example.com pointing to the IP address, set an NS record for t.example.com pointing to t.example.com, and ultimately use t.example.com. The A record cannot be a subdomain of an NS record.
|
|
1067
|
+
|
|
1068
|
+
`xicmp`: It requires at least `CAP_NET_RAW` permissions and must be at the outermost level, i.e., the first element in the array. It cannot be used with `udpHop` or `dialerProxy`.
|
|
1069
|
+
|
|
1070
|
+
> `udp[n].settings`: header-custom | header-dns | mkcp-aes128gcm | noise | salamander | sudoku | xdns | xicmp
|
|
1071
|
+
|
|
1072
|
+
#### header-custom
|
|
1073
|
+
|
|
1074
|
+
```json
|
|
1075
|
+
{
|
|
1076
|
+
"client": [
|
|
1077
|
+
{
|
|
1078
|
+
"rand": 0,
|
|
1079
|
+
"randRange": "0-255",
|
|
1080
|
+
"type": "",
|
|
1081
|
+
"packet": []
|
|
1082
|
+
}
|
|
1083
|
+
],
|
|
1084
|
+
"server": [
|
|
1085
|
+
{
|
|
1086
|
+
"rand": 0,
|
|
1087
|
+
"randRange": "0-255",
|
|
1088
|
+
"type": "",
|
|
1089
|
+
"packet": []
|
|
1090
|
+
}
|
|
1091
|
+
]
|
|
1092
|
+
}
|
|
1093
|
+
```
|
|
1094
|
+
|
|
1095
|
+
`client[n].rand`: Adds a specified length of random bytes, which conflicts with `packet`.
|
|
1096
|
+
|
|
1097
|
+
`client[n].randRange`: Random byte range, default 0-255.
|
|
1098
|
+
|
|
1099
|
+
`client[n].type`: The `packet` type can be `array | str | hex | base64`, with the default being array.
|
|
1100
|
+
|
|
1101
|
+
`client[n].packet`: Adding fixed data conflicts with `rand`.
|
|
1102
|
+
|
|
1103
|
+
#### header-dns
|
|
1104
|
+
|
|
1105
|
+
```json
|
|
1106
|
+
{
|
|
1107
|
+
"domain": "www.example.com"
|
|
1108
|
+
}
|
|
1109
|
+
```
|
|
1110
|
+
|
|
1111
|
+
#### mkcp-aes128gcm
|
|
1112
|
+
|
|
1113
|
+
```json
|
|
1114
|
+
{
|
|
1115
|
+
"password": "your-password"
|
|
1116
|
+
}
|
|
1117
|
+
```
|
|
1118
|
+
|
|
1119
|
+
#### noise
|
|
1120
|
+
|
|
1121
|
+
```json
|
|
1122
|
+
{
|
|
1123
|
+
"reset": 0,
|
|
1124
|
+
"noise": [
|
|
1125
|
+
{
|
|
1126
|
+
"rand": "1-8192",
|
|
1127
|
+
"randRange": "0-255",
|
|
1128
|
+
"type": "",
|
|
1129
|
+
"packet": [],
|
|
1130
|
+
"delay": "10-20"
|
|
1131
|
+
}
|
|
1132
|
+
]
|
|
1133
|
+
}
|
|
1134
|
+
```
|
|
1135
|
+
|
|
1136
|
+
`noise[n].rand`: Adds random or specified length of random bytes, which conflicts with `packet`.
|
|
1137
|
+
|
|
1138
|
+
`noise[n].randRange`: Random byte range, default 0-255.
|
|
1139
|
+
|
|
1140
|
+
`noise[n].type`: The `packet` type can be `array | str | hex | base64`, with the default being array.
|
|
1141
|
+
|
|
1142
|
+
`noise[n].packet`: Adding fixed data conflicts with `rand`.
|
|
1143
|
+
|
|
1144
|
+
`noise[n].delay`: The unit is milliseconds. After sending one noise signal, a specified time is delayed before sending the next one.
|
|
1145
|
+
|
|
1146
|
+
#### salamander
|
|
1147
|
+
|
|
1148
|
+
```json
|
|
1149
|
+
{
|
|
1150
|
+
"password": "your-password"
|
|
1151
|
+
}
|
|
1152
|
+
```
|
|
1153
|
+
|
|
1154
|
+
#### sudoku
|
|
1155
|
+
|
|
1156
|
+
```json
|
|
1157
|
+
{
|
|
1158
|
+
"password": "",
|
|
1159
|
+
"ascii": "",
|
|
1160
|
+
|
|
1161
|
+
"customTable": "",
|
|
1162
|
+
"customTables": [""],
|
|
1163
|
+
|
|
1164
|
+
"paddingMin": 0,
|
|
1165
|
+
"paddingMax": 0
|
|
1166
|
+
}
|
|
1167
|
+
```
|
|
1168
|
+
|
|
1169
|
+
Same as the TCP version.
|
|
1170
|
+
|
|
1171
|
+
#### xdns
|
|
1172
|
+
|
|
1173
|
+
```json
|
|
1174
|
+
{
|
|
1175
|
+
"domain": "www.example.com"
|
|
1176
|
+
}
|
|
1177
|
+
```
|
|
1178
|
+
|
|
1179
|
+
#### xicmp
|
|
1180
|
+
|
|
1181
|
+
```json
|
|
1182
|
+
{
|
|
1183
|
+
"listenIp": "0.0.0.0",
|
|
1184
|
+
"id": 0
|
|
1185
|
+
}
|
|
1186
|
+
```
|
|
1187
|
+
|
|
1188
|
+
`listenIp`: The IP address to listen on.
|
|
1189
|
+
|
|
1190
|
+
`id`: If there are multiple clients under the same IP address, it is recommended that the server keep it at 0.
|
|
1191
|
+
|
|
1192
|
+
> `quicParams`: [quicParamsObject](#quicParams)
|
|
1193
|
+
|
|
1194
|
+
#### quicParams
|
|
1195
|
+
|
|
1196
|
+
```json
|
|
1197
|
+
{
|
|
1198
|
+
"congestion": "force-brutal",
|
|
1199
|
+
"debug": false,
|
|
1200
|
+
"brutalUp": "60 mbps",
|
|
1201
|
+
"brutalDown": 0,
|
|
1202
|
+
"udpHop": {
|
|
1203
|
+
"ports": "20000-50000",
|
|
1204
|
+
"interval": "5-10"
|
|
1205
|
+
},
|
|
1206
|
+
"initStreamReceiveWindow": 8388608,
|
|
1207
|
+
"maxStreamReceiveWindow": 8388608,
|
|
1208
|
+
"initConnectionReceiveWindow": 20971520,
|
|
1209
|
+
"maxConnectionReceiveWindow": 20971520,
|
|
1210
|
+
"maxIdleTimeout": 30,
|
|
1211
|
+
"keepAlivePeriod": 0,
|
|
1212
|
+
"disablePathMTUDiscovery": false,
|
|
1213
|
+
"maxIncomingStreams": 1024
|
|
1214
|
+
}
|
|
1215
|
+
```
|
|
1216
|
+
|
|
1217
|
+
Used for QUIC configuration tuning of XHTTP H3 and Hysteria.
|
|
1218
|
+
|
|
1219
|
+
> `congestion`: reno | bbr | brutal | force-brutal
|
|
1220
|
+
|
|
1221
|
+
Congestion control algorithm. Hysteria defaults to `brutal`, XHTTP H3 defaults to `bbr`.
|
|
1222
|
+
|
|
1223
|
+
`reno`/`bbr`: Well-known algorithms.
|
|
1224
|
+
|
|
1225
|
+
`brutal`: Negotiates a fixed packet sending rate with the peer or falls back to BBR. Only supported with Hysteria transport (since XHTTP has no negotiation mechanism).
|
|
1226
|
+
|
|
1227
|
+
`force-brutal`: Same as `brutal`, but forces upstream to use the `brutalUp` fixed packet sending rate, ignoring peer negotiation.
|
|
1228
|
+
|
|
1229
|
+
> `debug`: false | true
|
|
1230
|
+
|
|
1231
|
+
Enable bbr/brutal congestion control logging.
|
|
1232
|
+
|
|
1233
|
+
> `brutalUp`: string
|
|
1234
|
+
|
|
1235
|
+
> `brutalDown`: string
|
|
1236
|
+
|
|
1237
|
+
Upload/Download rate limits. Default is 0.
|
|
1238
|
+
|
|
1239
|
+
The format is user-friendly and supports various common bit-per-second notations, including `1000000`, `100kb`, `20 mb`, `100 mbps`, `1g`, `1 tbps`, etc. It is case-insensitive, and spaces between the number and unit are optional. If no unit is specified, it defaults to bps (bits per second). It cannot be lower than 65535 bps.
|
|
1240
|
+
|
|
1241
|
+
The negotiation behavior is consistent with Hysteria brutal:
|
|
1242
|
+
|
|
1243
|
+
The server's value limits the maximum Brutal mode rate that the client can choose. 0 means no limit on the client.
|
|
1244
|
+
|
|
1245
|
+
If the client sets this to 0, it uses BBR mode. If not 0, it uses Brutal mode, subject to the server's limit.
|
|
1246
|
+
|
|
1247
|
+
Note relativity: Server upload is client download, and server download is client upload.
|
|
1248
|
+
|
|
1249
|
+
> `udpHop`: {"ports": string, "interval": number}
|
|
1250
|
+
|
|
1251
|
+
UDP port hopping configuration.
|
|
1252
|
+
|
|
1253
|
+
`ports` is the port range for hopping. It can be a numeric string, such as `"1234"`; or a numeric range, such as `"1145-1919"` (indicating ports 1145 to 1919, totaling 775 ports). Commas can be used for segmentation, such as `11,13,15-17` (indicating port 11, port 13, and ports 15 to 17, totaling 5 ports).
|
|
1254
|
+
|
|
1255
|
+
`interval` is the port hopping interval in seconds. Minimum is 5, default is 30 seconds.
|
|
1256
|
+
|
|
1257
|
+
> `initStreamReceiveWindow`: number
|
|
1258
|
+
|
|
1259
|
+
> `maxStreamReceiveWindow`: number
|
|
1260
|
+
|
|
1261
|
+
> `initConnectionReceiveWindow`: number
|
|
1262
|
+
|
|
1263
|
+
> `maxConnectionReceiveWindow`: number
|
|
1264
|
+
|
|
1265
|
+
These four are specific QUIC window parameters. **Unless you fully understand what you are doing, it is not recommended to modify these values.** If you must modify them, it is recommended to keep the ratio of the stream receive window to the connection receive window at 2:5.
|
|
1266
|
+
|
|
1267
|
+
> `maxIdleTimeout`: number
|
|
1268
|
+
|
|
1269
|
+
Maximum idle timeout (seconds). The server will close the connection if no data is received from the client for this duration. Range: 4~120 seconds. Default: 30 seconds.
|
|
1270
|
+
|
|
1271
|
+
> `keepAlivePeriod`: number
|
|
1272
|
+
|
|
1273
|
+
QUIC KeepAlive interval (seconds). Range: 2~60 seconds. Disabled by default.
|
|
1274
|
+
|
|
1275
|
+
> `disablePathMTUDiscovery`: bool
|
|
1276
|
+
|
|
1277
|
+
Whether to disable Path MTU Discovery.
|
|
1278
|
+
|
|
1279
|
+
In other implementations, !linux && !windows && !darwin OS are forcibly disabled, while in xray it is not mandatory. If your OS is not (linux || windows || darwin), you may need to disable it manually.
|
|
1280
|
+
|
|
1281
|
+
> `maxIncomingStreams`: number
|
|
1282
|
+
|
|
1283
|
+
Server-side parameters, if set, must not be less than 8.
|