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.
Files changed (153) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +502 -0
  3. package/data/docs/_index.json +533 -0
  4. package/data/docs/basic__api.md +148 -0
  5. package/data/docs/basic__dns.md +366 -0
  6. package/data/docs/basic__fakedns.md +202 -0
  7. package/data/docs/basic__geodata.md +64 -0
  8. package/data/docs/basic__inbound.md +159 -0
  9. package/data/docs/basic__index.md +136 -0
  10. package/data/docs/basic__log.md +67 -0
  11. package/data/docs/basic__metrics.md +262 -0
  12. package/data/docs/basic__observatory.md +115 -0
  13. package/data/docs/basic__outbound.md +164 -0
  14. package/data/docs/basic__policy.md +140 -0
  15. package/data/docs/basic__reverse.md +268 -0
  16. package/data/docs/basic__routing.md +474 -0
  17. package/data/docs/basic__stats.md +61 -0
  18. package/data/docs/basic__transport.md +1283 -0
  19. package/data/docs/features__features_browser_dialer.md +61 -0
  20. package/data/docs/features__features_env.md +66 -0
  21. package/data/docs/features__features_fallback.md +110 -0
  22. package/data/docs/features__features_index.md +17 -0
  23. package/data/docs/features__features_multiple.md +144 -0
  24. package/data/docs/features__features_xtls.md +13 -0
  25. package/data/docs/inbounds__inbounds_dokodemo.md +11 -0
  26. package/data/docs/inbounds__inbounds_http.md +80 -0
  27. package/data/docs/inbounds__inbounds_hysteria.md +60 -0
  28. package/data/docs/inbounds__inbounds_index.md +22 -0
  29. package/data/docs/inbounds__inbounds_shadowsocks.md +118 -0
  30. package/data/docs/inbounds__inbounds_socks.md +87 -0
  31. package/data/docs/inbounds__inbounds_trojan.md +78 -0
  32. package/data/docs/inbounds__inbounds_tun.md +47 -0
  33. package/data/docs/inbounds__inbounds_tunnel.md +86 -0
  34. package/data/docs/inbounds__inbounds_vless.md +135 -0
  35. package/data/docs/inbounds__inbounds_vmess.md +95 -0
  36. package/data/docs/inbounds__inbounds_wireguard.md +78 -0
  37. package/data/docs/outbounds__outbounds_blackhole.md +42 -0
  38. package/data/docs/outbounds__outbounds_dns.md +97 -0
  39. package/data/docs/outbounds__outbounds_freedom.md +170 -0
  40. package/data/docs/outbounds__outbounds_http.md +70 -0
  41. package/data/docs/outbounds__outbounds_hysteria.md +39 -0
  42. package/data/docs/outbounds__outbounds_index.md +24 -0
  43. package/data/docs/outbounds__outbounds_loopback.md +65 -0
  44. package/data/docs/outbounds__outbounds_shadowsocks.md +105 -0
  45. package/data/docs/outbounds__outbounds_socks.md +58 -0
  46. package/data/docs/outbounds__outbounds_trojan.md +49 -0
  47. package/data/docs/outbounds__outbounds_vless.md +122 -0
  48. package/data/docs/outbounds__outbounds_vmess.md +76 -0
  49. package/data/docs/outbounds__outbounds_wireguard.md +141 -0
  50. package/data/docs/transports__transports_grpc.md +137 -0
  51. package/data/docs/transports__transports_h2.md +11 -0
  52. package/data/docs/transports__transports_http.md +11 -0
  53. package/data/docs/transports__transports_httpupgrade.md +61 -0
  54. package/data/docs/transports__transports_hysteria.md +110 -0
  55. package/data/docs/transports__transports_index.md +19 -0
  56. package/data/docs/transports__transports_mkcp.md +125 -0
  57. package/data/docs/transports__transports_quic.md +11 -0
  58. package/data/docs/transports__transports_raw.md +156 -0
  59. package/data/docs/transports__transports_splithttp.md +11 -0
  60. package/data/docs/transports__transports_tcp.md +11 -0
  61. package/data/docs/transports__transports_websocket.md +75 -0
  62. package/data/docs/transports__transports_xhttp.md +11 -0
  63. package/dist/data/compatibility.js +170 -0
  64. package/dist/data/compatibility.js.map +1 -0
  65. package/dist/data/geocatalogue.js +191 -0
  66. package/dist/data/geocatalogue.js.map +1 -0
  67. package/dist/docs.js +339 -0
  68. package/dist/docs.js.map +1 -0
  69. package/dist/handlers.js +217 -0
  70. package/dist/handlers.js.map +1 -0
  71. package/dist/index.js +66 -0
  72. package/dist/index.js.map +1 -0
  73. package/dist/lint.js +737 -0
  74. package/dist/lint.js.map +1 -0
  75. package/dist/schemas/protocols/blackhole.js +16 -0
  76. package/dist/schemas/protocols/blackhole.js.map +1 -0
  77. package/dist/schemas/protocols/common.js +32 -0
  78. package/dist/schemas/protocols/common.js.map +1 -0
  79. package/dist/schemas/protocols/dns.js +14 -0
  80. package/dist/schemas/protocols/dns.js.map +1 -0
  81. package/dist/schemas/protocols/dokodemo.js +17 -0
  82. package/dist/schemas/protocols/dokodemo.js.map +1 -0
  83. package/dist/schemas/protocols/freedom.js +45 -0
  84. package/dist/schemas/protocols/freedom.js.map +1 -0
  85. package/dist/schemas/protocols/http.js +38 -0
  86. package/dist/schemas/protocols/http.js.map +1 -0
  87. package/dist/schemas/protocols/hysteria.js +51 -0
  88. package/dist/schemas/protocols/hysteria.js.map +1 -0
  89. package/dist/schemas/protocols/index.js +50 -0
  90. package/dist/schemas/protocols/index.js.map +1 -0
  91. package/dist/schemas/protocols/loopback.js +11 -0
  92. package/dist/schemas/protocols/loopback.js.map +1 -0
  93. package/dist/schemas/protocols/shadowsocks.js +60 -0
  94. package/dist/schemas/protocols/shadowsocks.js.map +1 -0
  95. package/dist/schemas/protocols/socks.js +42 -0
  96. package/dist/schemas/protocols/socks.js.map +1 -0
  97. package/dist/schemas/protocols/trojan.js +34 -0
  98. package/dist/schemas/protocols/trojan.js.map +1 -0
  99. package/dist/schemas/protocols/tun.js +19 -0
  100. package/dist/schemas/protocols/tun.js.map +1 -0
  101. package/dist/schemas/protocols/vless.js +44 -0
  102. package/dist/schemas/protocols/vless.js.map +1 -0
  103. package/dist/schemas/protocols/vmess.js +48 -0
  104. package/dist/schemas/protocols/vmess.js.map +1 -0
  105. package/dist/schemas/protocols/wireguard.js +34 -0
  106. package/dist/schemas/protocols/wireguard.js.map +1 -0
  107. package/dist/schemas/security/index.js +16 -0
  108. package/dist/schemas/security/index.js.map +1 -0
  109. package/dist/schemas/security/reality.js +35 -0
  110. package/dist/schemas/security/reality.js.map +1 -0
  111. package/dist/schemas/security/tls.js +46 -0
  112. package/dist/schemas/security/tls.js.map +1 -0
  113. package/dist/schemas/security/xtls.js +17 -0
  114. package/dist/schemas/security/xtls.js.map +1 -0
  115. package/dist/schemas/transports/grpc.js +18 -0
  116. package/dist/schemas/transports/grpc.js.map +1 -0
  117. package/dist/schemas/transports/httpupgrade.js +14 -0
  118. package/dist/schemas/transports/httpupgrade.js.map +1 -0
  119. package/dist/schemas/transports/hysteria.js +25 -0
  120. package/dist/schemas/transports/hysteria.js.map +1 -0
  121. package/dist/schemas/transports/index.js +32 -0
  122. package/dist/schemas/transports/index.js.map +1 -0
  123. package/dist/schemas/transports/mkcp.js +34 -0
  124. package/dist/schemas/transports/mkcp.js.map +1 -0
  125. package/dist/schemas/transports/raw.js +19 -0
  126. package/dist/schemas/transports/raw.js.map +1 -0
  127. package/dist/schemas/transports/websocket.js +15 -0
  128. package/dist/schemas/transports/websocket.js.map +1 -0
  129. package/dist/schemas/transports/xhttp.js +34 -0
  130. package/dist/schemas/transports/xhttp.js.map +1 -0
  131. package/dist/search.js +78 -0
  132. package/dist/search.js.map +1 -0
  133. package/dist/state.js +87 -0
  134. package/dist/state.js.map +1 -0
  135. package/dist/tools.js +274 -0
  136. package/dist/tools.js.map +1 -0
  137. package/dist/tools_impl/diff.js +55 -0
  138. package/dist/tools_impl/diff.js.map +1 -0
  139. package/dist/tools_impl/github.js +416 -0
  140. package/dist/tools_impl/github.js.map +1 -0
  141. package/dist/tools_impl/merge.js +181 -0
  142. package/dist/tools_impl/merge.js.map +1 -0
  143. package/dist/tools_impl/refresh.js +46 -0
  144. package/dist/tools_impl/refresh.js.map +1 -0
  145. package/dist/tools_impl/suggest.js +169 -0
  146. package/dist/tools_impl/suggest.js.map +1 -0
  147. package/dist/types.js +10 -0
  148. package/dist/types.js.map +1 -0
  149. package/dist/utils.js +81 -0
  150. package/dist/utils.js.map +1 -0
  151. package/dist/validate.js +408 -0
  152. package/dist/validate.js.map +1 -0
  153. package/package.json +62 -0
@@ -0,0 +1,78 @@
1
+ ---
2
+ url: https://xtls.github.io/en/config/inbounds/wireguard.html
3
+ source_url: https://raw.githubusercontent.com/XTLS/Xray-docs-next/main/docs/en/config/inbounds/wireguard.md
4
+ title: WireGuard
5
+ category: inbounds
6
+ slug: inbounds/wireguard
7
+ fetched_at: 2026-05-04T18:42:52.729Z
8
+ ---
9
+ # WireGuard
10
+
11
+ User-space WireGuard protocol implementation.
12
+
13
+ ::: danger
14
+ **The WireGuard protocol is not designed specifically for bypassing firewalls. If used as the outer layer to cross the firewall, its distinct characteristics may lead to the server being blocked.**
15
+ :::
16
+
17
+ ## InboundConfigurationObject
18
+
19
+ ```json
20
+ {
21
+ "secretKey": "PRIVATE_KEY",
22
+ "peers": [
23
+ {
24
+ "publicKey": "PUBLIC_KEY",
25
+ "allowedIPs": [""]
26
+ }
27
+ ],
28
+ "mtu": 1420 // optional, default 1420
29
+ }
30
+ ```
31
+
32
+ > `secretKey`: string
33
+
34
+ Private key. Required.
35
+
36
+ > `mtu`: int
37
+
38
+ The MTU size of the underlying WireGuard TUN.
39
+
40
+ <details>
41
+ <summary>Method to Calculate MTU</summary>
42
+
43
+ The structure of a WireGuard packet is as follows:
44
+
45
+ ```
46
+ - 20-byte IPv4 header or 40 byte IPv6 header
47
+ - 8-byte UDP header
48
+ - 4-byte type
49
+ - 4-byte key index
50
+ - 8-byte nonce
51
+ - N-byte encrypted data
52
+ - 16-byte authentication tag
53
+ ```
54
+
55
+ `N-byte encrypted data` is the MTU value we need. Depending on whether the endpoint is IPv4 or IPv6, the specific value can be 1440 (IPv4) or 1420 (IPv6). If you are in a special network environment, you may need to subtract more (e.g., home broadband PPPoE requires an extra -8).
56
+
57
+ </details>
58
+
59
+ > `peers`: \[ [Peers](#peers) \]
60
+
61
+ List of peers, where each item is a peer configuration.
62
+
63
+ ### Peers
64
+
65
+ ```json
66
+ {
67
+ "publicKey": "PUBLIC_KEY",
68
+ "allowedIPs": ["0.0.0.0/0"] // optional, default ["0.0.0.0/0", "::/0"]
69
+ }
70
+ ```
71
+
72
+ > `publicKey`: string
73
+
74
+ Public key, used for verification.
75
+
76
+ > `allowedIPs`: string array
77
+
78
+ Allowed source IPs.
@@ -0,0 +1,42 @@
1
+ ---
2
+ url: https://xtls.github.io/en/config/outbounds/blackhole.html
3
+ source_url: https://raw.githubusercontent.com/XTLS/Xray-docs-next/main/docs/en/config/outbounds/blackhole.md
4
+ title: Blackhole
5
+ category: outbounds
6
+ slug: outbounds/blackhole
7
+ fetched_at: 2026-05-04T18:42:54.758Z
8
+ ---
9
+ # Blackhole
10
+
11
+ Blackhole is an outbound data protocol that blocks all outbound data. When used in conjunction with [Routing Configuration](../routing.md), it can achieve the effect of blocking access to certain websites.
12
+
13
+ ## OutboundConfigurationObject
14
+
15
+ ```json
16
+ {
17
+ "response": {
18
+ "type": "none"
19
+ }
20
+ }
21
+ ```
22
+
23
+ > `response`: [ResponseObject](#responseobject)
24
+
25
+ Configures the response data of the Blackhole.
26
+
27
+ After receiving data to be forwarded, Blackhole will send the specified response data, then close the connection. The data to be forwarded will be discarded.
28
+ If this item is not specified, Blackhole will close the connection immediately.
29
+
30
+ ### ResponseObject
31
+
32
+ ```json
33
+ {
34
+ "type": "none"
35
+ }
36
+ ```
37
+
38
+ > `type`: "http" | "none"
39
+
40
+ When `type` is `"none"` (default value), Blackhole will close the connection immediately.
41
+
42
+ When `type` is `"http"`, Blackhole will send back a simple HTTP 403 response packet, then close the connection.
@@ -0,0 +1,97 @@
1
+ ---
2
+ url: https://xtls.github.io/en/config/outbounds/dns.html
3
+ source_url: https://raw.githubusercontent.com/XTLS/Xray-docs-next/main/docs/en/config/outbounds/dns.md
4
+ title: DNS
5
+ category: outbounds
6
+ slug: outbounds/dns
7
+ fetched_at: 2026-05-04T18:42:55.246Z
8
+ ---
9
+ # DNS
10
+
11
+ DNS is an outbound protocol used to receive DNS queries sent in by routing, then forward or process them according to rules.
12
+
13
+ This outbound only supports traditional plaintext DNS queries over UDP and TCP; non-plaintext DNS protocols such as DoH, DoT, and DoQ are not applicable to this outbound. Common scenarios include TUN, transparent proxy, or `dokodemo-door` receiving DNS traffic and then routing sending that traffic to this outbound.
14
+
15
+ It can allow queries to the target DNS server, `hijack` them to the built-in [DNS server](../dns.md) for further processing, drop them, or explicitly refuse them according to rules. It can also rewrite the target address, port, and transport protocol.
16
+
17
+ ## OutboundConfigurationObject
18
+
19
+ ```json
20
+ {
21
+ "network": "udp",
22
+ "address": "1.1.1.1",
23
+ "port": 53,
24
+ "userLevel": 0,
25
+ "rules": [
26
+ {
27
+ "action": "reject",
28
+ "domain": ["domain:example.com"]
29
+ },
30
+ {
31
+ "action": "direct",
32
+ "qtype": 65,
33
+ "domain": ["geosite:geolocation-!cn"]
34
+ }
35
+ ]
36
+ }
37
+ ```
38
+
39
+ The example above only demonstrates the field syntax. See the full example below for a complete configuration.
40
+
41
+ > `network`: [ "tcp" | "udp" ]
42
+
43
+ Modifies the transport protocol used for DNS traffic. Available values are `"tcp"` and `"udp"`. If omitted, the original transport method is preserved.
44
+
45
+ > `address`: address
46
+
47
+ Modifies the DNS server address. If omitted, the address specified by the source is preserved.
48
+
49
+ > `port`: number
50
+
51
+ Modifies the DNS server port. If omitted, the port specified by the source is preserved.
52
+
53
+ > `userLevel`: number
54
+
55
+ User level. Connections will use the [local policy](../policy.md#levelpolicyobject) corresponding to this user level.
56
+
57
+ The value of `userLevel` corresponds to the `level` value in [policy](../policy.md#policyobject). If omitted, it defaults to `0`.
58
+
59
+ > `rules`: \[[RuleObject](#ruleobject)\]
60
+
61
+ Matches DNS query rules in order, and supports fine-grained control by `qtype` and `domain`.
62
+
63
+ If no rule is matched, the built-in fallback rule is used: A and AAAA queries are imported into the built-in DNS module, while other query types are explicitly refused.
64
+
65
+ ## RuleObject
66
+
67
+ ```json
68
+ {
69
+ "action": "hijack",
70
+ "qtype": 1,
71
+ "domain": ["geosite:cn"]
72
+ }
73
+ ```
74
+
75
+ All matching conditions in a rule are combined with AND logic. If a condition is omitted, that condition is not restricted.
76
+
77
+ > `action`: [ "direct" | "hijack" | "drop" | "reject" ]
78
+
79
+ Defines the action to take when the rule matches.
80
+
81
+ - `direct`: Allows the query directly to the target DNS server. If outbound-level `network`, `address`, or `port` is also configured, the query is forwarded to the rewritten target.
82
+ - `hijack`: Imports the query into the built-in [DNS server](../dns.md) for further processing. This can be used for additional routing based on the built-in DNS configuration. Currently, only A and AAAA records are supported.
83
+ - `drop`: Drops the request directly without returning a response.
84
+ - `reject`: Returns an explicit refusal response. Compared with `drop`, this can prevent some applications from waiting too long for a DNS timeout or repeatedly retrying.
85
+
86
+ > `qtype`: number | string
87
+
88
+ Matches DNS query types. The forms are as follows:
89
+
90
+ - Integer value: a specific query type, such as `"qtype": 1` for an A query, or `"qtype": 28` for an AAAA query.
91
+ - String: can be a digits-only string such as `"qtype": "28"`, or a numeric range such as `"qtype": "5-10"`, which represents the 6 types from type 5 to type 10. Commas can be used for segmentation, such as `11,13,15-17`, which represents the 5 types: type 11, type 13, and type 15 to type 17.
92
+
93
+ For specific type numbers, refer to the [IANA documentation](https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml).
94
+
95
+ > `domain`: [string]
96
+
97
+ Matches a list of domains. The syntax is the same as [`domain` in routing rules](../routing.md#ruleobject).
@@ -0,0 +1,170 @@
1
+ ---
2
+ url: https://xtls.github.io/en/config/outbounds/freedom.html
3
+ source_url: https://raw.githubusercontent.com/XTLS/Xray-docs-next/main/docs/en/config/outbounds/freedom.md
4
+ title: Freedom (fragment, noises)
5
+ category: outbounds
6
+ slug: outbounds/freedom
7
+ fetched_at: 2026-05-04T18:42:55.761Z
8
+ ---
9
+ # Freedom (fragment, noises)
10
+
11
+ Freedom is an outbound protocol used to send (normal) TCP or UDP data to any network.
12
+
13
+ ::: warning
14
+ This outbound has a default safety policy in server-side and reverse-proxy scenarios, which may block some targets. See `finalRules` below for how to allow them.
15
+ :::
16
+
17
+ ## OutboundConfigurationObject
18
+
19
+ ```json
20
+ {
21
+ "domainStrategy": "AsIs",
22
+ "redirect": "127.0.0.1:3366",
23
+ "userLevel": 0,
24
+ "fragment": {
25
+ "packets": "tlshello",
26
+ "length": "100-200",
27
+ "interval": "10-20" // Unit: ms
28
+ },
29
+ "noises": [
30
+ {
31
+ "type": "base64",
32
+ "packet": "7nQBAAABAAAAAAAABnQtcmluZwZtc2VkZ2UDbmV0AAABAAE=",
33
+ "delay": "10-16"
34
+ }
35
+ ],
36
+ "proxyProtocol": 0,
37
+ "finalRules": [
38
+ {
39
+ "action": "block",
40
+ "network": "tcp",
41
+ "port": "22,25,465,587"
42
+ },
43
+ {
44
+ "action": "block",
45
+ "ip": ["geoip:cn"]
46
+ }
47
+ ]
48
+ }
49
+ ```
50
+
51
+ > `domainStrategy`: "AsIs"<br>
52
+ > "UseIP" | "UseIPv6v4" | "UseIPv6" | "UseIPv4v6" | "UseIPv4"<br>
53
+ > "ForceIP" | "ForceIPv6v4" | "ForceIPv6" | "ForceIPv4v6" | "ForceIPv4"
54
+
55
+ Default value `"AsIs"`.
56
+
57
+ The meanings of all parameters are roughly equivalent to `domainStrategy` in [sockopt](../transport.md#sockoptobject).
58
+
59
+ Only using `"AsIs"` here allows passing the domain name to the subsequent `sockopt` module. If set to non-`"AsIs"` here, causing the domain to be resolved to a specific IP, it will invalidate the subsequent `sockopt.domainStrategy` and its related `happyEyeballs`. (There is no negative impact if these two settings are not adjusted).
60
+
61
+ When sending UDP, Freedom ignores `domainStrategy` in `sockopt` for some reasons and forcibly prefers IPv4 by default.
62
+
63
+ > `redirect`: address_port
64
+
65
+ Freedom will forcibly send all data to the specified address (instead of the address specified by the inbound).
66
+
67
+ The value is a string, e.g., `"127.0.0.1:80"`, `":1234"`.
68
+
69
+ When the address is not specified, e.g., `":443"`, Freedom will not modify the original destination address.
70
+ When the port is `0`, e.g., `"xray.com:0"`, Freedom will not modify the original port.
71
+
72
+ > `userLevel`: number
73
+
74
+ User level. Connections will use the [Local Policy](../policy.md#levelpolicyobject) corresponding to this user level.
75
+
76
+ The value of `userLevel` corresponds to the value of `level` in [policy](../policy.md#policyobject). If not specified, it defaults to 0.
77
+
78
+ > `fragment`: map
79
+
80
+ A set of key-value configuration items used to control outgoing TCP fragmentation. In some cases, it can deceive censorship systems, such as bypassing SNI blacklists.
81
+
82
+ `"length"` and `"interval"` are both [Int32Range](../../development/intro/guide.md#int32range) types.
83
+
84
+ `"packets"`: Supports two fragmentation modes. `"1-3"` is TCP stream slicing, applied to the 1st through 3rd data writes by the client. `"tlshello"` is TLS handshake packet slicing.
85
+
86
+ `"length"`: Fragment packet length (byte).
87
+
88
+ `"interval"`: Fragment interval (ms).
89
+
90
+ When `interval` is 0 and `"packets": "tlshello"` is set, the fragmented Client Hello will be sent in one TCP packet (provided its original size does not exceed MSS or MTU causing automatic system fragmentation).
91
+
92
+ > `noises`: array
93
+
94
+ UDP noise, used to send some random data as "noise" before sending a UDP connection. Presence of this structure implies enablement. It might deceive sniffers, or it might disrupt normal connections. _Use at your own risk._ For this reason, it bypasses port 53 because that breaks DNS.
95
+
96
+ It is an array where multiple noise packets to be sent can be defined. A single element in the array is defined as follows:
97
+
98
+ `"type"`: Noise packet type. Currently supports `"rand"` (random data), `"str"` (user-defined string), `"base64"` (base64 encoded custom binary data).
99
+
100
+ `"packet"`: The content of the packet to be sent based on the preceding `type`.
101
+
102
+ - When `type` is `rand`, this specifies the length of the random data. It can be a fixed value `"100"` or a floating range `"50-150"`.
103
+ - When `type` is `str`, this specifies the string to be sent.
104
+ - When `type` is `hex`, this specifies binary data in hex format.
105
+ - When `type` is `base64`, this specifies base64 encoded binary data.
106
+
107
+ `"delay"`: Delay in milliseconds. After sending this noise packet, the core will wait for this time before sending the next noise packet or real data. Defaults to no wait. It is an [Int32Range](../../development/intro/guide.md#int32range) type.
108
+
109
+ > `proxyProtocol`: number
110
+
111
+ PROXY protocol is usually used with `redirect` to redirect traffic to Nginx or other backend services that have the PROXY protocol enabled. If the backend service does not support PROXY protocol, the connection will be disconnected.
112
+
113
+ The value of `proxyProtocol` is the PROXY protocol version number. Options are `1` or `2`. If not specified, it defaults to `0` (disabled).
114
+
115
+ > `finalRules`: \[[FinalRuleObject](#finalruleobject)\]
116
+
117
+ Matches Freedom final outbound rules in order, and allows or blocks connection targets.
118
+
119
+ Compared with blocking in `routing`, `finalRules` applies at Freedom's final outbound stage: matching happens after the final IP is resolved and before dialing; in addition, UDP is also matched packet by packet during send and receive, making it stricter and more thorough. Each rule match takes about 50-150 ns.
120
+
121
+ Note: whenever Freedom needs to apply `finalRules`, if `domainStrategy` is `AsIs` and the target is a domain, Freedom still resolves the target to an IP through the operating system DNS before matching rules. At that point the target is no longer a domain, so the later `sockopt.domainStrategy` and its `happyEyeballs` no longer take effect.
122
+
123
+ ::: warning
124
+ There is a default fallback safety policy for server-side and reverse-proxy scenarios:
125
+
126
+ If no explicit rule matches, the built-in fallback rule is used: traffic from the VLESS reverse proxy blocks all targets by default; traffic from `VLESS`, `VMess`, `Trojan`, `Shadowsocks`, `Hysteria`, or `WireGuard` inbounds blocks private and reserved IP ranges by default; other traffic is fully allowed by default.
127
+
128
+ If the server needs to allow clients to access some internal services, explicitly configure `allow` rules and limit them to the necessary `network`, `ip`, and `port` whenever possible.
129
+
130
+ If the server also needs features that rely on passing the domain to `sockopt` (such as `sockopt.domainStrategy` or `happyEyeballs`), it cannot continue relying on this default safety policy. You can configure the first rule as an `allow` rule without any matching conditions to restore the previous behavior; this is also equivalent to disabling this default safety policy, so evaluate the security impact yourself.
131
+ :::
132
+
133
+ ### FinalRuleObject
134
+
135
+ ```json
136
+ {
137
+ "action": "block",
138
+ "network": "tcp,udp",
139
+ "port": "53,443",
140
+ "ip": ["10.0.0.0/8", "2001:db8::/32"],
141
+ "blockDelay": "30-90"
142
+ }
143
+ ```
144
+
145
+ All matching conditions in a rule are combined with AND logic. If a condition is omitted, that condition is not restricted.
146
+
147
+ > `action`: "allow" | "block"
148
+
149
+ Defines the action to take when the rule matches.
150
+
151
+ - `allow`: Allows the target.
152
+ - `block`: Blocks the target.
153
+
154
+ > `network`: "tcp" | "udp" | "tcp,udp"
155
+
156
+ Matches the network type. The rule takes effect when the connection method matches. It can also be written as a string array, such as `["tcp", "udp"]`. If omitted, all networks are matched.
157
+
158
+ > `port`: number | string
159
+
160
+ Target port range. The syntax is the same as [`port` in routing rules](../routing.md#ruleobject). If omitted, all ports are matched.
161
+
162
+ > `ip`: \[string\]
163
+
164
+ An array where each item represents an IP range. The rule takes effect when an item matches the target IP. The syntax is the same as [`ip` in routing rules](../routing.md#ruleobject). If omitted, all IPs are matched.
165
+
166
+ > `blockDelay`: string
167
+
168
+ Sets how long the blackhole state lasts after a blocking rule matches.
169
+
170
+ When a rule's `action` is `block` and the target matches, Freedom puts the connection into a blackhole state and closes it after this duration expires. The unit is seconds. It can be written as a fixed value or a range, for example `30` or `30-90`. If omitted, it defaults to `30-90`, which means a random value within that range.
@@ -0,0 +1,70 @@
1
+ ---
2
+ url: https://xtls.github.io/en/config/outbounds/http.html
3
+ source_url: https://raw.githubusercontent.com/XTLS/Xray-docs-next/main/docs/en/config/outbounds/http.md
4
+ title: HTTP
5
+ category: outbounds
6
+ slug: outbounds/http
7
+ fetched_at: 2026-05-04T18:42:56.244Z
8
+ ---
9
+ # HTTP
10
+
11
+ HTTP protocol.
12
+
13
+ ::: danger
14
+ **The HTTP protocol does not encrypt transmission, so it is not suitable for transmission over the public internet. It makes it easier to become a "zombie" (bot) used for attacks.**
15
+ :::
16
+
17
+ ::: tip
18
+ `http` can only proxy the TCP protocol; UDP-based protocols cannot pass through.
19
+ :::
20
+
21
+ ## OutboundConfigurationObject
22
+
23
+ ```json
24
+ {
25
+ "address": "192.168.108.1",
26
+ "port": 3128,
27
+ "user": "my-username",
28
+ "pass": "my-password",
29
+ "level": 0,
30
+ "email": "love@xray.com",
31
+ "headers": {
32
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36",
33
+ "Accept-Language": "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2"
34
+ }
35
+ }
36
+ ```
37
+
38
+ ::: tip
39
+ Currently, `security` and `tlsSettings` in `streamSettings` are effective in the HTTP outbound protocol.
40
+ :::
41
+
42
+ > `address`: string
43
+
44
+ HTTP proxy server address. Required.
45
+
46
+ > `port`: int
47
+
48
+ HTTP proxy server port. Required.
49
+
50
+ > `user`: string
51
+
52
+ Username, string type. Required if the remote server requires authentication; otherwise, do not include this item.
53
+
54
+ > `pass`: string
55
+
56
+ Password, string type. Required if the remote server requires authentication; otherwise, do not include this item.
57
+
58
+ > `level`: number
59
+
60
+ User level. The connection will use the [local policy](../policy.md#levelpolicyobject) corresponding to this user level. Optional if the remote server requires authentication; otherwise, do not include this item.
61
+
62
+ The value of `userLevel` corresponds to the value of `level` in [policy](../policy.md#policyobject). If not specified, the default is 0.
63
+
64
+ > `email`: string
65
+
66
+ Email address, used to identify the user. Optional if the remote server requires authentication; otherwise, do not include this item.
67
+
68
+ > `headers`: map{ string, string }
69
+
70
+ HTTP headers, a map of key-value pairs. Each key represents the name of an HTTP header. All key-value pairs will be attached to every request.
@@ -0,0 +1,39 @@
1
+ ---
2
+ url: https://xtls.github.io/en/config/outbounds/hysteria.html
3
+ source_url: https://raw.githubusercontent.com/XTLS/Xray-docs-next/main/docs/en/config/outbounds/hysteria.md
4
+ title: Hysteria
5
+ category: outbounds
6
+ slug: outbounds/hysteria
7
+ fetched_at: 2026-05-04T18:43:00.303Z
8
+ ---
9
+ # Hysteria
10
+
11
+ Client implementation of the Hysteria protocol.
12
+
13
+ This page is very simple because the Hysteria protocol is actually composed of a simple proxy control protocol and a tuned QUIC underlying transport. In Xray, the proxy protocol and the underlying transport are separated. For more details (such as `brutal`), please refer to [hysteriaSettings](../transports/hysteria.md) [finalmask.quicParams](../transport.md#quicParams) in the underlying transport section.
14
+
15
+ ::: tip
16
+ The `hysteria protocol` itself has no authentication. When using with a non `hysteria` transport layer, it will be unable to proxy `udp`, and using it with other transport layers is not recommended.
17
+ :::
18
+
19
+ ## OutboundConfigurationObject
20
+
21
+ ```json
22
+ {
23
+ "version": 2,
24
+ "address": "192.168.108.1",
25
+ "port": 3128
26
+ }
27
+ ```
28
+
29
+ > `version`: number
30
+
31
+ Hysteria version, must be 2.
32
+
33
+ > `address`: string
34
+
35
+ Hysteria proxy server address, required.
36
+
37
+ > `port`: int
38
+
39
+ Hysteria proxy server port, required.
@@ -0,0 +1,24 @@
1
+ ---
2
+ url: https://xtls.github.io/en/config/outbounds/index.html
3
+ source_url: https://raw.githubusercontent.com/XTLS/Xray-docs-next/main/docs/en/config/outbounds/index.md
4
+ title: Xray Outbound Protocols
5
+ category: outbounds
6
+ slug: outbounds/index
7
+ fetched_at: 2026-05-04T18:42:54.250Z
8
+ ---
9
+ # Xray Outbound Protocols
10
+
11
+ Xray supports the following outbound protocols:
12
+
13
+ - [Blackhole](blackhole.md)
14
+ - [DNS](dns.md)
15
+ - [Freedom (fragment, noises)](freedom.md)
16
+ - [HTTP](http.md)
17
+ - [Loopback](loopback.md)
18
+ - [Shadowsocks](shadowsocks.md)
19
+ - [Socks](socks.md)
20
+ - [Trojan](trojan.md)
21
+ - [VLESS (XTLS Vision Seed)](vless.md)
22
+ - [VMess](vmess.md)
23
+ - [WireGuard](wireguard.md)
24
+ - [Hysteria](hysteria.md)
@@ -0,0 +1,65 @@
1
+ ---
2
+ url: https://xtls.github.io/en/config/outbounds/loopback.html
3
+ source_url: https://raw.githubusercontent.com/XTLS/Xray-docs-next/main/docs/en/config/outbounds/loopback.md
4
+ title: Loopback
5
+ category: outbounds
6
+ slug: outbounds/loopback
7
+ fetched_at: 2026-05-04T18:42:56.760Z
8
+ ---
9
+ # Loopback
10
+
11
+ Loopback is an outbound data protocol. Its function is to re-inject data sent through this outbound back into the routing inbound, allowing the data to be processed by the routing system again without leaving Xray-core.
12
+
13
+ ## OutboundConfigurationObject
14
+
15
+ ```json
16
+ {
17
+ "inboundTag": "TagUseAsInbound"
18
+ }
19
+ ```
20
+
21
+ > `inboundTag`: string
22
+
23
+ The inbound protocol identifier used for re-routing.
24
+
25
+ This identifier can be used for `inboundTag` in routing rules, indicating that data from this outbound can be processed again by the corresponding routing rules.
26
+
27
+ ### How to use?
28
+
29
+ If you need to perform finer-grained splitting on traffic that has already been split by routing rules—for example, if TCP traffic and UDP traffic split by the same group of routing rules need to go through different outbounds—you can use the `loopback` outbound to achieve this.
30
+
31
+ ```json
32
+ {
33
+ "outbounds": [
34
+ {
35
+ "protocol": "loopback",
36
+ "tag": "need-to-split",
37
+ "settings": {
38
+ "inboundTag": "traffic-input" // This tag is used for the inboundTag of RuleObject below
39
+ }
40
+ },
41
+ {
42
+ "tag": "tcp-output"
43
+ // settings like protocol, settings, streamSettings
44
+ },
45
+ {
46
+ "tag": "udp-output"
47
+ // settings like protocol, settings, streamSettings
48
+ }
49
+ ],
50
+ "routing": {
51
+ "rules": [
52
+ {
53
+ "inboundTag": ["traffic-input"], // tag set in loopback
54
+ "network": "tcp",
55
+ "outboundTag": "tcp-output"
56
+ },
57
+ {
58
+ "inboundTag": ["traffic-input"], // tag set in loopback
59
+ "network": "udp",
60
+ "outboundTag": "udp-output"
61
+ }
62
+ ]
63
+ }
64
+ }
65
+ ```