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,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
url: https://xtls.github.io/en/config/transports/grpc.html
|
|
3
|
+
source_url: https://raw.githubusercontent.com/XTLS/Xray-docs-next/main/docs/en/config/transports/grpc.md
|
|
4
|
+
title: gRPC
|
|
5
|
+
category: transports
|
|
6
|
+
slug: transports/grpc
|
|
7
|
+
fetched_at: 2026-05-04T18:43:03.782Z
|
|
8
|
+
---
|
|
9
|
+
# gRPC
|
|
10
|
+
|
|
11
|
+
A transport protocol based on gRPC.
|
|
12
|
+
|
|
13
|
+
It is based on the HTTP/2 protocol and, theoretically, can be relayed through other servers that support HTTP/2 (such as Nginx).
|
|
14
|
+
gRPC (HTTP/2) has built-in multiplexing. It is not recommended to enable mux.cool when using gRPC and HTTP/2.
|
|
15
|
+
|
|
16
|
+
::: danger
|
|
17
|
+
**It is recommended to switch to [XHTTP](https://github.com/XTLS/Xray-core/discussions/4113). Its advantages over gRPC are noted in the STREAM-UP/ONE section.**
|
|
18
|
+
:::
|
|
19
|
+
|
|
20
|
+
::: warning ⚠⚠⚠
|
|
21
|
+
|
|
22
|
+
- gRPC does not support specifying Host. Please fill in the **correct domain name** in the outbound proxy address, or fill in `ServerName` in `(x)tlsSettings`, otherwise the connection will fail.
|
|
23
|
+
- gRPC does not support falling back to other services.
|
|
24
|
+
- gRPC services are at risk of active probing. It is recommended to use reverse proxy tools such as Caddy or Nginx to split traffic via Path prefix.
|
|
25
|
+
:::
|
|
26
|
+
|
|
27
|
+
::: tip
|
|
28
|
+
If you use reverse proxies like Caddy or Nginx, please note the following:
|
|
29
|
+
|
|
30
|
+
- Ensure the reverse proxy server has enabled HTTP/2.
|
|
31
|
+
- Use HTTP/2 or h2c (Caddy), grpc_pass (Nginx) to connect to Xray.
|
|
32
|
+
- The Path for normal mode is `/${serviceName}/Tun`, and for Multi mode is `/${serviceName}/TunMulti`.
|
|
33
|
+
- If you need to receive the client IP, you can pass the client IP by having Caddy / Nginx send the `X-Real-IP` header.
|
|
34
|
+
:::
|
|
35
|
+
|
|
36
|
+
::: tip
|
|
37
|
+
If you are using fallback, please note the following:
|
|
38
|
+
|
|
39
|
+
- Falling back to gRPC is not recommended due to the risk of active probing.
|
|
40
|
+
- Please ensure `h2` is in the first position in (x)tlsSettings.alpn, otherwise gRPC (HTTP/2) may fail to complete the TLS handshake.
|
|
41
|
+
- gRPC cannot be split by Path.
|
|
42
|
+
:::
|
|
43
|
+
|
|
44
|
+
## GRPCObject
|
|
45
|
+
|
|
46
|
+
`GRPCObject` corresponds to the `grpcSettings` item in the transport configuration.
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"authority": "grpc.example.com",
|
|
51
|
+
"serviceName": "name",
|
|
52
|
+
"multiMode": false,
|
|
53
|
+
"user_agent": "custom user agent",
|
|
54
|
+
"idle_timeout": 60,
|
|
55
|
+
"health_check_timeout": 20,
|
|
56
|
+
"permit_without_stream": false,
|
|
57
|
+
"initial_windows_size": 0
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
> `authority`: string
|
|
62
|
+
|
|
63
|
+
A string. Can be used as Host to achieve some other purposes.
|
|
64
|
+
|
|
65
|
+
> `serviceName`: string
|
|
66
|
+
|
|
67
|
+
A string. Specifies the service name, **similar to** Path in HTTP/2.
|
|
68
|
+
The client uses this name for communication, and the server verifies if the service name matches.
|
|
69
|
+
|
|
70
|
+
::: tip
|
|
71
|
+
When `serviceName` starts with a slash, you can customize the path. It requires at least two slashes.<br>
|
|
72
|
+
For example, fill in `"serviceName": "/my/sample/path1|path2"` on the server side, and the client can fill in `"serviceName": "/my/sample/path1"` or `"/my/sample/path2"`.
|
|
73
|
+
:::
|
|
74
|
+
|
|
75
|
+
> `user_agent`: string
|
|
76
|
+
|
|
77
|
+
::: tip
|
|
78
|
+
**Only** needs to be configured on **outbound** (**client**).
|
|
79
|
+
:::
|
|
80
|
+
|
|
81
|
+
Set the User-Agent for gRPC. This may prevent some CDNs from blocking gRPC traffic.
|
|
82
|
+
|
|
83
|
+
> `multiMode`: true | false <Badge text="BETA" type="warning"/>
|
|
84
|
+
|
|
85
|
+
`true` enables `multiMode`. Default value: `false`.
|
|
86
|
+
|
|
87
|
+
This is an **experimental** option. It may not be kept long-term and cross-version compatibility is not guaranteed. This mode can bring about a 20% performance improvement in **test environments**, but actual results vary depending on transfer rates.
|
|
88
|
+
|
|
89
|
+
::: tip
|
|
90
|
+
**Only** needs to be configured on **outbound** (**client**).
|
|
91
|
+
:::
|
|
92
|
+
|
|
93
|
+
> `idle_timeout`: number
|
|
94
|
+
|
|
95
|
+
Unit: seconds. When there is no data transmission during this period, a health check will be performed. If this value is set below `10`, `10` will be used (the minimum value).
|
|
96
|
+
|
|
97
|
+
::: tip
|
|
98
|
+
If you are not using reverse proxy tools like Caddy or Nginx (**usually not**), and set this below `60`, the server might send unexpected h2 GOAWAY frames to close existing connections.
|
|
99
|
+
:::
|
|
100
|
+
|
|
101
|
+
Health checks are **disabled** by default.
|
|
102
|
+
|
|
103
|
+
::: tip
|
|
104
|
+
**Only** needs to be configured on **outbound** (**client**).
|
|
105
|
+
:::
|
|
106
|
+
|
|
107
|
+
::: tip
|
|
108
|
+
May resolve some "disconnection" issues.
|
|
109
|
+
:::
|
|
110
|
+
|
|
111
|
+
> `health_check_timeout`: number
|
|
112
|
+
|
|
113
|
+
Unit: seconds. The timeout for health checks. If the health check is not completed within this time, and there is still no data transmission, the health check is considered failed. Default value is `20`.
|
|
114
|
+
|
|
115
|
+
::: tip
|
|
116
|
+
**Only** needs to be configured on **outbound** (**client**).
|
|
117
|
+
:::
|
|
118
|
+
|
|
119
|
+
> `permit_without_stream`: true | false
|
|
120
|
+
|
|
121
|
+
`true` allows health checks when there are no sub-connections (streams). Default value is `false`.
|
|
122
|
+
|
|
123
|
+
::: tip
|
|
124
|
+
**Only** needs to be configured on **outbound** (**client**).
|
|
125
|
+
:::
|
|
126
|
+
|
|
127
|
+
> `initial_windows_size`: number
|
|
128
|
+
|
|
129
|
+
Initial window size for h2 Stream. When the value is less than or equal to `0`, this feature does not take effect. When the value is greater than `65535`, the Dynamic Window mechanism will be disabled. Default value is `0` (disabled).
|
|
130
|
+
|
|
131
|
+
::: tip
|
|
132
|
+
**Only** needs to be configured on **outbound** (**client**).
|
|
133
|
+
:::
|
|
134
|
+
|
|
135
|
+
::: tip
|
|
136
|
+
When going through Cloudflare CDN, you can set the value to `65536` or higher (disabling Dynamic Window) to prevent Cloudflare CDN from sending unexpected h2 GOAWAY frames to close existing connections.
|
|
137
|
+
:::
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
url: https://xtls.github.io/en/config/transports/h2.html
|
|
3
|
+
source_url: https://raw.githubusercontent.com/XTLS/Xray-docs-next/main/docs/en/config/transports/h2.md
|
|
4
|
+
title: HTTP/2
|
|
5
|
+
category: transports
|
|
6
|
+
slug: transports/h2
|
|
7
|
+
fetched_at: 2026-05-04T18:43:05.840Z
|
|
8
|
+
---
|
|
9
|
+
# HTTP/2
|
|
10
|
+
|
|
11
|
+
See [XHTTP: Beyond REALITY](https://github.com/XTLS/Xray-core/discussions/4113)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
url: https://xtls.github.io/en/config/transports/http.html
|
|
3
|
+
source_url: https://raw.githubusercontent.com/XTLS/Xray-docs-next/main/docs/en/config/transports/http.md
|
|
4
|
+
title: HTTP
|
|
5
|
+
category: transports
|
|
6
|
+
slug: transports/http
|
|
7
|
+
fetched_at: 2026-05-04T18:43:06.340Z
|
|
8
|
+
---
|
|
9
|
+
# HTTP
|
|
10
|
+
|
|
11
|
+
See [XHTTP: Beyond REALITY](https://github.com/XTLS/Xray-core/discussions/4113)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
url: https://xtls.github.io/en/config/transports/httpupgrade.html
|
|
3
|
+
source_url: https://raw.githubusercontent.com/XTLS/Xray-docs-next/main/docs/en/config/transports/httpupgrade.md
|
|
4
|
+
title: HTTPUpgrade
|
|
5
|
+
category: transports
|
|
6
|
+
slug: transports/httpupgrade
|
|
7
|
+
fetched_at: 2026-05-04T18:43:04.806Z
|
|
8
|
+
---
|
|
9
|
+
# HTTPUpgrade
|
|
10
|
+
|
|
11
|
+
A protocol that implements HTTP 1.1 upgrade requests and responses similar to WebSocket. This allows it to be reverse-proxied by CDNs or Nginx just like WebSocket, but without the need to implement other parts of the WebSocket protocol, resulting in higher efficiency.
|
|
12
|
+
Its design is not recommended for standalone use; instead, it is intended to work with security protocols like TLS.
|
|
13
|
+
|
|
14
|
+
::: danger
|
|
15
|
+
**It is recommended to switch to [XHTTP](https://github.com/XTLS/Xray-core/discussions/4113) to avoid significant traffic fingerprints such as HTTPUpgrade's "ALPN is http/1.1".**
|
|
16
|
+
:::
|
|
17
|
+
|
|
18
|
+
## HttpUpgradeObject
|
|
19
|
+
|
|
20
|
+
`HttpUpgradeObject` corresponds to the `httpupgradeSettings` item in transport configuration.
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"acceptProxyProtocol": false,
|
|
25
|
+
"path": "/",
|
|
26
|
+
"host": "xray.com",
|
|
27
|
+
"headers": {
|
|
28
|
+
"key": "value"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
> `acceptProxyProtocol`: true | false
|
|
34
|
+
|
|
35
|
+
Only used for inbound; indicates whether to accept PROXY protocol.
|
|
36
|
+
|
|
37
|
+
[PROXY protocol](https://www.haproxy.org/download/2.2/doc/proxy-protocol.txt) is dedicated to passing the real source IP and port of the request. **If you don't know what it is, please ignore this item for now.**
|
|
38
|
+
|
|
39
|
+
Common reverse proxy software (such as HAProxy, Nginx) can be configured to send it. VLESS fallbacks xver can also send it.
|
|
40
|
+
|
|
41
|
+
When set to `true`, after the underlying TCP connection is established, the requester must send PROXY protocol v1 or v2 first; otherwise, the connection will be closed.
|
|
42
|
+
|
|
43
|
+
> `path`: string
|
|
44
|
+
|
|
45
|
+
The HTTP path used by HTTPUpgrade. Default value is `"/"`.
|
|
46
|
+
|
|
47
|
+
If the client path contains the `ed` parameter (e.g., `/mypath?ed=2560`), `Early Data` will be enabled to reduce latency. The value represents the threshold for the first packet length. If the first packet length exceeds this value, `Early Data` will not be enabled. The recommended value is 2560.
|
|
48
|
+
|
|
49
|
+
> `host`: string
|
|
50
|
+
|
|
51
|
+
The host sent in the HTTP request of HTTPUpgrade. Default value is empty. If the server-side value is empty, the host value sent by the client is not verified.
|
|
52
|
+
|
|
53
|
+
When this value is specified on the server, or specified in `headers`, it will verify whether it is consistent with the host requested by the client.
|
|
54
|
+
|
|
55
|
+
Priority of the host sent by the client: `host` > `headers` > `address`
|
|
56
|
+
|
|
57
|
+
> `headers`: map \{string: string\}
|
|
58
|
+
|
|
59
|
+
Client-only. Custom HTTP headers. A key-value pair, where each key represents the name of an HTTP header, and the corresponding value is a string.
|
|
60
|
+
|
|
61
|
+
Default value is empty.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
url: https://xtls.github.io/en/config/transports/hysteria.html
|
|
3
|
+
source_url: https://raw.githubusercontent.com/XTLS/Xray-docs-next/main/docs/en/config/transports/hysteria.md
|
|
4
|
+
title: Hysteria
|
|
5
|
+
category: transports
|
|
6
|
+
slug: transports/hysteria
|
|
7
|
+
fetched_at: 2026-05-04T18:43:05.303Z
|
|
8
|
+
---
|
|
9
|
+
# Hysteria
|
|
10
|
+
|
|
11
|
+
Xray implementation of the underlying QUIC transport for Hysteria2, typically used with hysteria [outbound](../outbounds/hysteria.md) and hysteria [inbound](../inbounds/hysteria.md), and is compatible with the official implementation in this case.
|
|
12
|
+
|
|
13
|
+
## HysteriaObject
|
|
14
|
+
|
|
15
|
+
`HysteriaObject` corresponds to the `hysteriaSettings` item in the transport configuration.
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"version": 2,
|
|
20
|
+
"auth": "password",
|
|
21
|
+
"udpIdleTimeout": 60,
|
|
22
|
+
"masquerade": {
|
|
23
|
+
"type": "",
|
|
24
|
+
|
|
25
|
+
"dir": "",
|
|
26
|
+
|
|
27
|
+
"url": "",
|
|
28
|
+
"rewriteHost": false,
|
|
29
|
+
"insecure": false,
|
|
30
|
+
|
|
31
|
+
"content": "",
|
|
32
|
+
"headers": {
|
|
33
|
+
"key": "value"
|
|
34
|
+
},
|
|
35
|
+
"statusCode": 0
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
> `version`: number
|
|
41
|
+
|
|
42
|
+
Hysteria version, must be 2.
|
|
43
|
+
|
|
44
|
+
> `auth`: string
|
|
45
|
+
|
|
46
|
+
Hysteria authentication password. Must be consistent between the server and the client.
|
|
47
|
+
|
|
48
|
+
When used with `hysteria inbound`, it will be overridden by `clients` (if it exists).
|
|
49
|
+
|
|
50
|
+
> `udpIdleTimeout`: number
|
|
51
|
+
|
|
52
|
+
Unit: seconds, default 60.
|
|
53
|
+
|
|
54
|
+
Idle wait time for a single `quic native udp` connection. If this time is too long, it may not be strictly adhered to and may be terminated by the policy first.
|
|
55
|
+
|
|
56
|
+
> `masquerade`: [MasqObject](#MasqObject)
|
|
57
|
+
|
|
58
|
+
HTTP/3 page masquerading.
|
|
59
|
+
|
|
60
|
+
### MasqObject
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"type": "",
|
|
65
|
+
|
|
66
|
+
"dir": "",
|
|
67
|
+
|
|
68
|
+
"url": "",
|
|
69
|
+
"rewriteHost": false,
|
|
70
|
+
"insecure": false,
|
|
71
|
+
|
|
72
|
+
"content": "",
|
|
73
|
+
"headers": {
|
|
74
|
+
"key": "value"
|
|
75
|
+
},
|
|
76
|
+
"statusCode": 0
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
> `type`: "file" | "proxy" | "string"
|
|
81
|
+
|
|
82
|
+
If left blank, the default 404 page will be displayed.
|
|
83
|
+
|
|
84
|
+
> `dir`: string
|
|
85
|
+
|
|
86
|
+
Configuration items when type is file.
|
|
87
|
+
|
|
88
|
+
> `url`: string
|
|
89
|
+
|
|
90
|
+
Configuration items when type is proxy.
|
|
91
|
+
|
|
92
|
+
> `rewriteHost`: false | true
|
|
93
|
+
|
|
94
|
+
Configuration items when type is proxy.
|
|
95
|
+
|
|
96
|
+
> `insecure`: false | true
|
|
97
|
+
|
|
98
|
+
Configuration items when type is proxy.
|
|
99
|
+
|
|
100
|
+
> `content`: string
|
|
101
|
+
|
|
102
|
+
Configuration items when type is string.
|
|
103
|
+
|
|
104
|
+
> `headers`: map{ string, string }
|
|
105
|
+
|
|
106
|
+
Configuration items when type is string.
|
|
107
|
+
|
|
108
|
+
> `statusCode`: int
|
|
109
|
+
|
|
110
|
+
Configuration items when type is string.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
url: https://xtls.github.io/en/config/transports/index.html
|
|
3
|
+
source_url: https://raw.githubusercontent.com/XTLS/Xray-docs-next/main/docs/en/config/transports/index.md
|
|
4
|
+
title: Xray Transport Layer
|
|
5
|
+
category: transports
|
|
6
|
+
slug: transports/index
|
|
7
|
+
fetched_at: 2026-05-04T18:43:00.806Z
|
|
8
|
+
---
|
|
9
|
+
# Xray Transport Layer
|
|
10
|
+
|
|
11
|
+
Xray supports the following transport layers:
|
|
12
|
+
|
|
13
|
+
- [RAW](raw.md)
|
|
14
|
+
- [XHTTP: Beyond REALITY](xhttp.md)
|
|
15
|
+
- [mKCP](mkcp.md)
|
|
16
|
+
- [gRPC](grpc.md)
|
|
17
|
+
- [WebSocket](websocket.md)
|
|
18
|
+
- [HTTPUpgrade](httpupgrade.md)
|
|
19
|
+
- [Hysteria](hysteria.md)
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
url: https://xtls.github.io/en/config/transports/mkcp.html
|
|
3
|
+
source_url: https://raw.githubusercontent.com/XTLS/Xray-docs-next/main/docs/en/config/transports/mkcp.md
|
|
4
|
+
title: mKCP
|
|
5
|
+
category: transports
|
|
6
|
+
slug: transports/mkcp
|
|
7
|
+
fetched_at: 2026-05-04T18:43:03.280Z
|
|
8
|
+
---
|
|
9
|
+
# mKCP
|
|
10
|
+
|
|
11
|
+
mKCP uses UDP to simulate TCP connections.
|
|
12
|
+
|
|
13
|
+
mKCP sacrifices bandwidth to reduce latency. To transmit the same amount of content, mKCP generally consumes more traffic than TCP.
|
|
14
|
+
|
|
15
|
+
::: tip
|
|
16
|
+
Please ensure that the firewall configuration on the host is correct.
|
|
17
|
+
:::
|
|
18
|
+
|
|
19
|
+
## KcpObject
|
|
20
|
+
|
|
21
|
+
`KcpObject` corresponds to the `kcpSettings` item in the transport configuration.
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"mtu": 1350,
|
|
26
|
+
"tti": 20,
|
|
27
|
+
"uplinkCapacity": 5,
|
|
28
|
+
"downlinkCapacity": 20,
|
|
29
|
+
"congestion": false,
|
|
30
|
+
"readBufferSize": 1,
|
|
31
|
+
"writeBufferSize": 1
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
::: TIP
|
|
36
|
+
The `header` and `seed` fields have been removed. Please use [FinalMask](../transport.md#finalmaskobject) for configuration.
|
|
37
|
+
|
|
38
|
+
Additionally, the previously default mKCP obfuscation has also been removed. To connect to a legacy server, you need to configure `mkcp-original` in FinalMask.
|
|
39
|
+
:::
|
|
40
|
+
|
|
41
|
+
> `mtu`: number
|
|
42
|
+
|
|
43
|
+
Maximum Transmission Unit.
|
|
44
|
+
Please select a value between 576 and 1460.
|
|
45
|
+
|
|
46
|
+
The default value is `1350`.
|
|
47
|
+
|
|
48
|
+
> `tti`: number
|
|
49
|
+
|
|
50
|
+
Transmission Time Interval, in milliseconds (ms). mKCP will send data at this frequency.
|
|
51
|
+
Please select a value between 10 and 100.
|
|
52
|
+
|
|
53
|
+
The default value is `50`.
|
|
54
|
+
|
|
55
|
+
> `uplinkCapacity`: number
|
|
56
|
+
|
|
57
|
+
Uplink capacity, i.e., the maximum bandwidth used by the host to send data. The unit is MB/s. Note that it is Byte, not bit.
|
|
58
|
+
Can be set to 0, representing a very small bandwidth.
|
|
59
|
+
|
|
60
|
+
The default value is `5`.
|
|
61
|
+
|
|
62
|
+
> `downlinkCapacity`: number
|
|
63
|
+
|
|
64
|
+
Downlink capacity, i.e., the maximum bandwidth used by the host to receive data. The unit is MB/s. Note that it is Byte, not bit.
|
|
65
|
+
Can be set to 0, representing a very small bandwidth.
|
|
66
|
+
|
|
67
|
+
The default value is `20`.
|
|
68
|
+
|
|
69
|
+
::: tip
|
|
70
|
+
`uplinkCapacity` and `downlinkCapacity` determine the transmission speed of mKCP.
|
|
71
|
+
Taking a client sending data as an example, the client's `uplinkCapacity` specifies the speed of sending data, while the server's `downlinkCapacity` specifies the speed of receiving data. The actual speed will be the smaller of the two values.
|
|
72
|
+
|
|
73
|
+
It is recommended to set `downlinkCapacity` to a larger value, such as 100, and set `uplinkCapacity` to the actual network speed. When the speed is insufficient, you can gradually increase the value of `uplinkCapacity` until it is about twice the bandwidth.
|
|
74
|
+
:::
|
|
75
|
+
|
|
76
|
+
> `congestion`: true | false
|
|
77
|
+
|
|
78
|
+
Whether to enable congestion control.
|
|
79
|
+
|
|
80
|
+
When congestion control is enabled, Xray automatically monitors network quality. When packet loss is severe, it automatically reduces throughput; when the network is smooth, it appropriately increases throughput.
|
|
81
|
+
|
|
82
|
+
The default value is `false`.
|
|
83
|
+
|
|
84
|
+
> `readBufferSize`: number
|
|
85
|
+
|
|
86
|
+
The read buffer size for a single connection, in MB.
|
|
87
|
+
|
|
88
|
+
The default value is `2`.
|
|
89
|
+
|
|
90
|
+
> `writeBufferSize`: number
|
|
91
|
+
|
|
92
|
+
The write buffer size for a single connection, in MB.
|
|
93
|
+
|
|
94
|
+
The default value is `2`.
|
|
95
|
+
|
|
96
|
+
::: tip
|
|
97
|
+
`readBufferSize` and `writeBufferSize` specify the memory size used by a single connection.
|
|
98
|
+
When high-speed transmission is required, specifying larger `readBufferSize` and `writeBufferSize` will improve speed to a certain extent, but it will also use more memory.
|
|
99
|
+
|
|
100
|
+
When the network speed does not exceed 20MB/s, the default value of 1MB can meet the demand; beyond that, you can appropriately increase the values of `readBufferSize` and `writeBufferSize`, and then manually balance the relationship between speed and memory.
|
|
101
|
+
:::
|
|
102
|
+
|
|
103
|
+
## Credits
|
|
104
|
+
|
|
105
|
+
- [@skywind3000](https://github.com/skywind3000) Invented and implemented the KCP protocol.
|
|
106
|
+
- [@xtaci](https://github.com/xtaci) Ported KCP from C implementation to Go.
|
|
107
|
+
- [@xiaokangwang](https://github.com/xiaokangwang) Tested the integration of KCP with Xray and submitted the initial PR.
|
|
108
|
+
|
|
109
|
+
## Improvements to the KCP Protocol
|
|
110
|
+
|
|
111
|
+
### Smaller Protocol Header
|
|
112
|
+
|
|
113
|
+
The native KCP protocol uses a fixed header of 24 bytes, while mKCP modifies this to 18 bytes for data packets and 16 bytes for acknowledgement (ACK) packets. Smaller headers help evade characteristic detection and increase transmission speed.
|
|
114
|
+
|
|
115
|
+
Additionally, native KCP's single ACK packet can only acknowledge the receipt of one data packet. This means that when KCP needs to acknowledge the receipt of 100 data packets, it sends 24 _100 = 2400 bytes of data. This includes a large amount of repetitive header data, causing bandwidth waste. mKCP compresses multiple ACK packets; 100 ACK packets require only 16 + 2 + 100_ 4 = 418 bytes, which is equivalent to one-sixth of the native size.
|
|
116
|
+
|
|
117
|
+
### ACK Packet Retransmission
|
|
118
|
+
|
|
119
|
+
The native KCP protocol sends acknowledgement (ACK) packets only once. If an ACK packet is lost, it inevitably leads to data retransmission, causing unnecessary bandwidth waste. mKCP retransmits ACK packets at a certain frequency until the sender confirms receipt. The size of a single ACK packet is 22 bytes, which is much smaller than the cost of retransmitting a data packet of over 1000 bytes.
|
|
120
|
+
|
|
121
|
+
### Connection State Control
|
|
122
|
+
|
|
123
|
+
mKCP can effectively open and close connections. When the remote host actively closes the connection, the connection is released within two seconds; when the remote host disconnects, the connection is released within a maximum of 30 seconds.
|
|
124
|
+
|
|
125
|
+
Native KCP does not support this scenario.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
url: https://xtls.github.io/en/config/transports/quic.html
|
|
3
|
+
source_url: https://raw.githubusercontent.com/XTLS/Xray-docs-next/main/docs/en/config/transports/quic.md
|
|
4
|
+
title: QUIC
|
|
5
|
+
category: transports
|
|
6
|
+
slug: transports/quic
|
|
7
|
+
fetched_at: 2026-05-04T18:43:06.851Z
|
|
8
|
+
---
|
|
9
|
+
# QUIC
|
|
10
|
+
|
|
11
|
+
See [XHTTP: Beyond REALITY](https://github.com/XTLS/Xray-core/discussions/4113)
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
---
|
|
2
|
+
url: https://xtls.github.io/en/config/transports/raw.html
|
|
3
|
+
source_url: https://raw.githubusercontent.com/XTLS/Xray-docs-next/main/docs/en/config/transports/raw.md
|
|
4
|
+
title: RAW
|
|
5
|
+
category: transports
|
|
6
|
+
slug: transports/raw
|
|
7
|
+
fetched_at: 2026-05-04T18:43:01.273Z
|
|
8
|
+
---
|
|
9
|
+
# RAW
|
|
10
|
+
|
|
11
|
+
Renamed from the former TCP transport layer (as the original name was ambiguous), the outbound RAW transport layer directly sends TCP or UDP data wrapped by the proxy protocol. The core does not use other transport layers (such as [XHTTP](https://github.com/XTLS/Xray-core/discussions/4113)) to carry its traffic.
|
|
12
|
+
|
|
13
|
+
It can be combined with various protocols in multiple modes.
|
|
14
|
+
|
|
15
|
+
## RawObject
|
|
16
|
+
|
|
17
|
+
`RawObject` corresponds to the `rawSettings` item in transport configuration.
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"acceptProxyProtocol": false,
|
|
22
|
+
"header": {
|
|
23
|
+
"type": "none"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
> `acceptProxyProtocol`: true | false
|
|
29
|
+
|
|
30
|
+
Only used for inbound; indicates whether to accept PROXY protocol.
|
|
31
|
+
|
|
32
|
+
[PROXY protocol](https://www.haproxy.org/download/2.2/doc/proxy-protocol.txt) is dedicated to passing the real source IP and port of the request. **If you don't know what it is, please ignore this item for now.**
|
|
33
|
+
|
|
34
|
+
Common reverse proxy software (such as HAProxy, Nginx) can be configured to send it. VLESS fallbacks xver can also send it.
|
|
35
|
+
|
|
36
|
+
When set to `true`, after the underlying TCP connection is established, the requester must send PROXY protocol v1 or v2 first; otherwise, the connection will be closed.
|
|
37
|
+
|
|
38
|
+
Default value is `false`.
|
|
39
|
+
|
|
40
|
+
> `header`: [NoneHeaderObject](#noneheaderobject) | [HttpHeaderobject](#httpheaderobject)
|
|
41
|
+
|
|
42
|
+
Packet header obfuscation settings. Default value is `NoneHeaderObject`.
|
|
43
|
+
|
|
44
|
+
::: tip
|
|
45
|
+
HTTP obfuscation cannot be traffic-split by other HTTP servers (like Nginx), but can be split by VLESS fallbacks path.
|
|
46
|
+
:::
|
|
47
|
+
|
|
48
|
+
### NoneHeaderObject
|
|
49
|
+
|
|
50
|
+
No obfuscation.
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"type": "none"
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
> `type`: "none"
|
|
59
|
+
|
|
60
|
+
Specifies no obfuscation.
|
|
61
|
+
|
|
62
|
+
### HttpHeaderObject
|
|
63
|
+
|
|
64
|
+
HTTP obfuscation configuration must be configured on the corresponding inbound and outbound connections simultaneously, and the content must be consistent.
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"type": "http",
|
|
69
|
+
"request": {},
|
|
70
|
+
"response": {}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
> `type`: "http"
|
|
75
|
+
|
|
76
|
+
Specifies HTTP obfuscation.
|
|
77
|
+
|
|
78
|
+
> `request`: [HTTPRequestObject](#httprequestobject)
|
|
79
|
+
|
|
80
|
+
HTTP Request.
|
|
81
|
+
|
|
82
|
+
> `response`: [HTTPResponseObject](#httpresponseobject)
|
|
83
|
+
|
|
84
|
+
HTTP Response.
|
|
85
|
+
|
|
86
|
+
#### HTTPRequestObject
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"version": "1.1",
|
|
91
|
+
"method": "GET",
|
|
92
|
+
"path": ["/"],
|
|
93
|
+
"headers": {
|
|
94
|
+
"Host": ["www.baidu.com", "www.bing.com"],
|
|
95
|
+
"User-Agent": [
|
|
96
|
+
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36",
|
|
97
|
+
"Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/53.0.2785.109 Mobile/14A456 Safari/601.1.46"
|
|
98
|
+
],
|
|
99
|
+
"Accept-Encoding": ["gzip, deflate"],
|
|
100
|
+
"Connection": ["keep-alive"],
|
|
101
|
+
"Pragma": "no-cache"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
> `version`: string
|
|
107
|
+
|
|
108
|
+
HTTP version. Default value is `"1.1"`.
|
|
109
|
+
|
|
110
|
+
> `method`: string
|
|
111
|
+
|
|
112
|
+
HTTP method. Default value is `"GET"`.
|
|
113
|
+
|
|
114
|
+
> `path`: \[ string \]
|
|
115
|
+
|
|
116
|
+
Path, an array of strings. Default value is `["/"]`. When there are multiple values, one is randomly selected for each request.
|
|
117
|
+
|
|
118
|
+
> `headers`: map{ string, \[ string \]}
|
|
119
|
+
|
|
120
|
+
HTTP headers. A key-value pair, where each key represents the name of an HTTP header, and the corresponding value is an array.
|
|
121
|
+
|
|
122
|
+
All keys will be attached to every request, and one corresponding value will be randomly selected. See the example above for default values.
|
|
123
|
+
|
|
124
|
+
#### HTTPResponseObject
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"version": "1.1",
|
|
129
|
+
"status": "200",
|
|
130
|
+
"reason": "OK",
|
|
131
|
+
"headers": {
|
|
132
|
+
"Content-Type": ["application/octet-stream", "video/mpeg"],
|
|
133
|
+
"Transfer-Encoding": ["chunked"],
|
|
134
|
+
"Connection": ["keep-alive"],
|
|
135
|
+
"Pragma": "no-cache"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
> `version`: string
|
|
141
|
+
|
|
142
|
+
HTTP version. Default value is `"1.1"`.
|
|
143
|
+
|
|
144
|
+
> `status`: string
|
|
145
|
+
|
|
146
|
+
HTTP status code. Default value is `"200"`.
|
|
147
|
+
|
|
148
|
+
> `reason`: string
|
|
149
|
+
|
|
150
|
+
HTTP status reason phrase. Default value is `"OK"`.
|
|
151
|
+
|
|
152
|
+
> `headers`: map {string, \[ string \]}
|
|
153
|
+
|
|
154
|
+
HTTP headers. A key-value pair, where each key represents the name of an HTTP header, and the corresponding value is an array.
|
|
155
|
+
|
|
156
|
+
All keys will be attached to every request, and one corresponding value will be randomly selected. See the example above for default values.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
url: https://xtls.github.io/en/config/transports/splithttp.html
|
|
3
|
+
source_url: https://raw.githubusercontent.com/XTLS/Xray-docs-next/main/docs/en/config/transports/splithttp.md
|
|
4
|
+
title: SplitHTTP
|
|
5
|
+
category: transports
|
|
6
|
+
slug: transports/splithttp
|
|
7
|
+
fetched_at: 2026-05-04T18:43:02.788Z
|
|
8
|
+
---
|
|
9
|
+
# SplitHTTP
|
|
10
|
+
|
|
11
|
+
See [XHTTP: Beyond REALITY](https://github.com/XTLS/Xray-core/discussions/4113)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
url: https://xtls.github.io/en/config/transports/tcp.html
|
|
3
|
+
source_url: https://raw.githubusercontent.com/XTLS/Xray-docs-next/main/docs/en/config/transports/tcp.md
|
|
4
|
+
title: TCP
|
|
5
|
+
category: transports
|
|
6
|
+
slug: transports/tcp
|
|
7
|
+
fetched_at: 2026-05-04T18:43:01.793Z
|
|
8
|
+
---
|
|
9
|
+
# TCP
|
|
10
|
+
|
|
11
|
+
See [RAW](./raw.md)
|