mirror of
https://github.com/XTLS/Xray-docs-next.git
synced 2026-10-04 04:48:17 +03:00
Fix: format
This commit is contained in:
@@ -26,7 +26,6 @@ Xray 提供以下环境变量以供修改 Xray 的一些底层配置。
|
||||
可打开此环境变量并根据是否有输出 XTLS 相关信息, 来确定 XTLS 是否成功被应用.
|
||||
:::
|
||||
|
||||
|
||||
## 资源文件路径
|
||||
|
||||
- 名称:`xray.location.asset` 或 `XRAY_LOCATION_ASSET`。
|
||||
|
||||
@@ -6,8 +6,7 @@ fallback 为 Xray 提供了高强度的防主动探测性, 并且具有独创的
|
||||
|
||||
fallback 也可以将不同类型的流量根据 path 进行分流, 从而实现一个端口, 多种服务共享.
|
||||
|
||||
目前您可以在使用 VLESS 或者 trojan 协议时, 通过配置 fallbacks 来使用回落这一特性, 并且创造出非常丰富的组合玩法.
|
||||
|
||||
目前您可以在使用 VLESS 或者 trojan 协议时, 通过配置 fallbacks 来使用回落这一特性, 并且创造出非常丰富的组合玩法.
|
||||
|
||||
## fallbacks 配置
|
||||
|
||||
@@ -48,6 +47,7 @@ VLESS 会把 TLS 解密后首包长度 < 18 或协议版本无效、身份认证
|
||||
其它传输组合必须删掉 `fallbacks` 项或所有子元素,此时也不会开启 Fallback,VLESS 会等待读够所需长度,协议版本无效或身份认证失败时,将直接断开连接。
|
||||
|
||||
> `name`: string
|
||||
|
||||
尝试匹配 TLS SNI(Server Name Indication),空为任意,默认为 ""
|
||||
|
||||
> `alpn`: string
|
||||
@@ -86,12 +86,10 @@ Fallback 内设置的 `alpn` 是匹配实际协商出的 ALPN,而 Inbound TLS
|
||||
|
||||
目前填 1 或 2,功能完全相同,只是结构不同,且前者可打印,后者为二进制。Xray 的 TCP 和 WS 入站均已支持接收 PROXY protocol。
|
||||
|
||||
|
||||
::: warning
|
||||
若你正在 [配置 Nginx 接收 PROXY protocol](https://docs.nginx.com/nginx/admin-guide/load-balancer/using-proxy-protocol/#configuring-nginx-to-accept-the-proxy-protocol),除了设置 proxy_protocol 外,还需设置 set_real_ip_from,否则可能会出问题。
|
||||
:::
|
||||
|
||||
|
||||
### 补充说明
|
||||
|
||||
- 将匹配到最精确的子元素,与子元素的排列顺序无关。若配置了几个 alpn 和 path 均相同的子元素,则会以最后的为准。
|
||||
@@ -99,6 +97,4 @@ Fallback 内设置的 `alpn` 是匹配实际协商出的 ALPN,而 Inbound TLS
|
||||
- 您可以查看更多的关于 Fallbacks 的使用技巧和心得
|
||||
- [Fallbacks 功能简析](../documents/level-1/fallbacks-lv1)
|
||||
|
||||
|
||||
## Fallbacks 设计理论 <Badge text="WIP" type="warning"/>
|
||||
|
||||
|
||||
@@ -28,26 +28,26 @@ $ xray run -confdir /etc/xray/confs
|
||||
|
||||
比如:
|
||||
|
||||
* base.json
|
||||
- base.json
|
||||
|
||||
```json
|
||||
{
|
||||
"log": {},
|
||||
"api": {},
|
||||
"dns": {},
|
||||
"stats": {},
|
||||
"policy": {},
|
||||
"transport": {},
|
||||
"routing": {},
|
||||
"inbounds": []
|
||||
"log": {},
|
||||
"api": {},
|
||||
"dns": {},
|
||||
"stats": {},
|
||||
"policy": {},
|
||||
"transport": {},
|
||||
"routing": {},
|
||||
"inbounds": []
|
||||
}
|
||||
```
|
||||
|
||||
* outbounds.json
|
||||
- outbounds.json
|
||||
|
||||
```json
|
||||
{
|
||||
"outbounds": []
|
||||
"outbounds": []
|
||||
}
|
||||
```
|
||||
|
||||
@@ -61,13 +61,13 @@ $ xray run -confdir /etc/xray/confs
|
||||
|
||||
如果需要改编日志 log 的级别,也不需要改 `base.json`,只需后续增加一个配置:
|
||||
|
||||
* debuglog.json
|
||||
- debuglog.json
|
||||
|
||||
```json
|
||||
{
|
||||
"log": {
|
||||
"loglevel": "debug"
|
||||
}
|
||||
"log": {
|
||||
"loglevel": "debug"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -77,8 +77,8 @@ $ xray run -confdir /etc/xray/confs
|
||||
|
||||
在 json 配置中的`inbounds`和`outbounds`是数组结构,他们有特殊的规则:
|
||||
|
||||
* 当配置中的数组元素有 2 或以上,覆盖前者的 inbounds/oubounds;
|
||||
* 当配置中的数组元素只有 1 个时,查找原有`tag`相同的元素进行覆盖;若无法找到:
|
||||
- 当配置中的数组元素有 2 或以上,覆盖前者的 inbounds/oubounds;
|
||||
- 当配置中的数组元素只有 1 个时,查找原有`tag`相同的元素进行覆盖;若无法找到:
|
||||
- 对于 inbounds,添加至最后(inbounds 内元素顺序无关)
|
||||
- 对于 outbounds,添加至最前(outbounds 默认首选出口);但如果文件名含有 tail(大小写均可),添加至最后。
|
||||
|
||||
@@ -86,44 +86,44 @@ $ xray run -confdir /etc/xray/confs
|
||||
|
||||
以下例子不是有效配置,只为展示上述规则。
|
||||
|
||||
* 000.json
|
||||
- 000.json
|
||||
|
||||
```json
|
||||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"protocol": "socks",
|
||||
"tag":"socks",
|
||||
"port": 1234
|
||||
}
|
||||
]
|
||||
"inbounds": [
|
||||
{
|
||||
"protocol": "socks",
|
||||
"tag": "socks",
|
||||
"port": 1234
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
* 001.json
|
||||
- 001.json
|
||||
|
||||
```json
|
||||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"protocol": "http",
|
||||
"tag":"http"
|
||||
}
|
||||
]
|
||||
"inbounds": [
|
||||
{
|
||||
"protocol": "http",
|
||||
"tag": "http"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
* 002.json
|
||||
- 002.json
|
||||
|
||||
```json
|
||||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"protocol": "socks",
|
||||
"tag":"socks",
|
||||
"port": 4321
|
||||
}
|
||||
]
|
||||
"inbounds": [
|
||||
{
|
||||
"protocol": "socks",
|
||||
"tag": "socks",
|
||||
"port": 4321
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
@@ -131,22 +131,20 @@ $ xray run -confdir /etc/xray/confs
|
||||
|
||||
```json
|
||||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"protocol": "socks",
|
||||
"tag":"socks",
|
||||
"port": 4321 // < 002顺序在000后,因此覆盖tag为socks的inbound端口为4321
|
||||
},
|
||||
{
|
||||
"protocol": "http",
|
||||
"tag":"http"
|
||||
}
|
||||
]
|
||||
"inbounds": [
|
||||
{
|
||||
"protocol": "socks",
|
||||
"tag": "socks",
|
||||
"port": 4321 // < 002顺序在000后,因此覆盖tag为socks的inbound端口为4321
|
||||
},
|
||||
{
|
||||
"protocol": "http",
|
||||
"tag": "http"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
## 推荐的多文件列表
|
||||
|
||||
执行:
|
||||
|
||||
@@ -29,18 +29,18 @@
|
||||
- iOS / Mac
|
||||
- [Shadowrocket](https://apps.apple.com/app/shadowrocket/id932747118)
|
||||
|
||||
|
||||
## Fallbacks
|
||||
|
||||
Fallbacks 是 Xray 独创的新型协议回落模式解析, 可有效防止主动探测, 自由配置常用端口多服务共享.
|
||||
|
||||
目前 Xray 中的 VLESS 和 trojan 协议支持Fallbacks.
|
||||
目前 Xray 中的 VLESS 和 trojan 协议支持 Fallbacks.
|
||||
|
||||
- [Fallbacks 配置说明](../fallback/#fallbacks-配置)
|
||||
- [Fallbacks 功能简析]()
|
||||
- [Fallbacks 设计理论](../fallback/#fallbacks-设计理论)
|
||||
|
||||
|
||||
## VLESS 分享链接标准
|
||||
|
||||
感谢 <img src="https://avatars2.githubusercontent.com/u/7822648?s=32" width="32px" height="32px" alt="a"/> [@DuckSoft](https://github.com/DuckSoft) 的提案!
|
||||
|
||||
目前为初步提案, 详情请见 [VMessAEAD / VLESS 分享链接标准提案](https://github.com/XTLS/Xray-core/issues/91)
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
> **XTLS 是 Xray 的原创黑科技, 也是使 Xray 性能一骑绝尘的核心动力**
|
||||
|
||||
<Badge text="WIP" type="warning"/>
|
||||
<Badge text="WIP" type="warning"/>
|
||||
|
||||
Reference in New Issue
Block a user