You've already forked Xray-docs-next
mirror of
https://github.com/XTLS/Xray-docs-next.git
synced 2025-12-15 09:55:33 +08:00
简化 outbound 设置;增补周边内容 (#754)
* Outbound simplification; Update compiling; Update commands; Update installation * Unpretty caught * Pretty? * ...
This commit is contained in:
committed by
GitHub
parent
25cd499b6f
commit
bc5d7231de
@@ -19,11 +19,6 @@
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": ["http", "tls"]
|
||||
},
|
||||
"allocate": {
|
||||
"strategy": "always",
|
||||
"refresh": 5,
|
||||
"concurrency": 3
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -55,7 +50,7 @@
|
||||
- 环境变量:以 `"env:"` 开头,后面是一个环境变量的名称,如 `"env:PORT"`。Xray 会以字符串形式解析这个环境变量。
|
||||
- 字符串:可以是一个数值类型的字符串,如 `"1234"`;或者一个数值范围,如 `"5-10"` 表示端口 5 到端口 10,这 6 个端口。可以使用逗号进行分段,如 `11,13,15-17` 表示端口 11、端口 13、端口 15 到端口 17 这 5 个端口。
|
||||
|
||||
当只有一个端口时,Xray 会在此端口监听入站连接。当指定了一个端口范围时,取决于 `allocate` 设置。
|
||||
当只有一个端口时,Xray 会在此端口监听入站连接。当指定了一个端口范围时,范围内的端口都会由 Xray 监听。
|
||||
|
||||
注意,监听一个端口是相当昂贵的操作,监听端口范围太大可能造成占用显著提高甚至导致 Xray 无法正常工作,一般来说监听数量接近四位数时可能就会开始出现问题,要使用一个很大的范围请考虑使用 iptables 进行重定向而不是在这里设置。
|
||||
|
||||
@@ -92,10 +87,6 @@
|
||||
|
||||
当设置了 sniffing 中的 enable 为 true, 还能嗅探出 bittorrent 类型的流量, 然后可以在路由中配置"protocol"项来设置规则处理 BT 流量, 比如服务端用来拦截 BT 流量, 或客户端固定转发 BT 流量到某个 VPS 去等.
|
||||
|
||||
> `allocate`: [AllocateObject](#allocateobject)
|
||||
|
||||
当设置了多个 port 时, 端口分配的具体设置
|
||||
|
||||
### SniffingObject
|
||||
|
||||
```json
|
||||
@@ -159,28 +150,3 @@ Xray只会嗅探 `destOverride` 中协议的域名用作路由,如果只想进
|
||||
::: tip
|
||||
在能保证 **被代理连接能得到正确的 DNS 解析** 时,使用 `routeOnly` 且开启 `destOverride` 的同时,将路由匹配策略 `domainStrategy` 设置为 `AsIs` 即可实现全程无 DNS 解析进行域名及 IP 分流。此时遇到 IP 规则匹配时使用的 IP 为域名原始 IP。
|
||||
:::
|
||||
|
||||
### AllocateObject
|
||||
|
||||
```json
|
||||
{
|
||||
"strategy": "always",
|
||||
"refresh": 5,
|
||||
"concurrency": 3
|
||||
}
|
||||
```
|
||||
|
||||
> `strategy`: "always" | "random"
|
||||
|
||||
端口分配策略。
|
||||
|
||||
- `"always"` 表示总是分配所有已指定的端口,`port` 中指定了多少个端口,Xray 就会监听这些端口。
|
||||
- `"random"` 表示随机开放端口,每隔 `refresh` 分钟在 `port` 范围中随机选取 `concurrency` 个端口来监听。
|
||||
|
||||
> `refresh`: number
|
||||
|
||||
随机端口刷新间隔,单位为分钟。最小值为 `2`,建议值为 `5`。这个属性仅当 `strategy` 设置为 `"random"` 时有效。
|
||||
|
||||
> `concurrency`: number
|
||||
|
||||
随机端口数量。最小值为 `1`,最大值为 `port` 范围的三分之一。建议值为 `3`。
|
||||
|
||||
@@ -19,9 +19,6 @@ VMess 依赖于系统时间,请确保使用 Xray 的系统 UTC 时间误差在
|
||||
],
|
||||
"default": {
|
||||
"level": 0
|
||||
},
|
||||
"detour": {
|
||||
"to": "tag_to_detour"
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -34,10 +31,6 @@ VMess 依赖于系统时间,请确保使用 Xray 的系统 UTC 时间误差在
|
||||
|
||||
当此配置用作动态端口时,Xray 会自动创建用户。
|
||||
|
||||
> `detour`: [DetourObject](#detourobject)
|
||||
|
||||
指示对应的出站协议使用另一个服务器。
|
||||
|
||||
> `default`: [DefaultObject](#defaultobject)
|
||||
|
||||
可选,clients 的默认配置。仅在配合`detour`时有效。
|
||||
@@ -79,18 +72,6 @@ level 的值, 对应 [policy](../policy.md#policyobject) 中 `level` 的值。
|
||||
|
||||
用户邮箱地址,用于区分不同用户的流量。
|
||||
|
||||
### DetourObject
|
||||
|
||||
```json
|
||||
{
|
||||
"to": "tag_to_detour"
|
||||
}
|
||||
```
|
||||
|
||||
> `to`: string
|
||||
|
||||
一个 inbound 的`tag`, 指定的 inbound 的必须是使用 VMess 协议的 inbound.
|
||||
|
||||
### DefaultObject
|
||||
|
||||
```json
|
||||
|
||||
@@ -14,18 +14,12 @@ HTTP 协议。
|
||||
|
||||
```json
|
||||
{
|
||||
"servers": [
|
||||
{
|
||||
"address": "192.168.108.1",
|
||||
"port": 3128,
|
||||
"users": [
|
||||
{
|
||||
"user": "my-username",
|
||||
"pass": "my-password"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"address": "192.168.108.1",
|
||||
"port": 3128,
|
||||
"user": "my-username",
|
||||
"pass": "my-password",
|
||||
"level": 0,
|
||||
"email": "love@xray.com",
|
||||
"headers": {
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36",
|
||||
"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"
|
||||
@@ -37,29 +31,6 @@ HTTP 协议。
|
||||
目前 HTTP 协议 outbound 中 `streamSettings` 设置 `security` 和 `tlsSettings` 是生效的。
|
||||
:::
|
||||
|
||||
> `servers`: \[ [ServerObject](#serverobject) \]
|
||||
|
||||
HTTP 服务器列表,其中每一项是一个服务器配置,若配置多个,循环使用 (RoundRobin)。
|
||||
|
||||
> `headers`: map{ string, string }
|
||||
|
||||
HTTP 头,一个键值对,每个键表示一个 HTTP 头的名称,每次请求会附上所有的键值对
|
||||
|
||||
### ServerObject
|
||||
|
||||
```json
|
||||
{
|
||||
"address": "192.168.108.1",
|
||||
"port": 3128,
|
||||
"users": [
|
||||
{
|
||||
"user": "my-username",
|
||||
"pass": "my-password"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
> `address`: string
|
||||
|
||||
HTTP 代理服务器地址,必填。
|
||||
@@ -68,23 +39,24 @@ HTTP 代理服务器地址,必填。
|
||||
|
||||
HTTP 代理服务器端口,必填。
|
||||
|
||||
> `user`: \[[AccountObject](#accountobject)\]
|
||||
|
||||
一个数组,数组中每个元素为一个用户帐号。默认值为空。
|
||||
|
||||
#### AccountObject
|
||||
|
||||
```json
|
||||
{
|
||||
"user": "my-username",
|
||||
"pass": "my-password"
|
||||
}
|
||||
```
|
||||
|
||||
> `user`: string
|
||||
|
||||
用户名,字符串类型。必填。
|
||||
用户名,字符串类型。如果对接服务端需要认证则必填,否则不要包含此项。
|
||||
|
||||
> `pass`: string
|
||||
|
||||
密码,字符串类型。必填。
|
||||
密码,字符串类型。如果对接服务端需要认证则必填,否则不要包含此项。
|
||||
|
||||
> `level`: number
|
||||
|
||||
用户等级,连接会使用这个用户等级对应的 [本地策略](../policy.md#levelpolicyobject)。如果对接服务端需要认证则选填,否则不要包含此项。
|
||||
|
||||
userLevel 的值, 对应 [policy](../policy.md#policyobject) 中 `level` 的值。 如不指定, 默认为 0。
|
||||
|
||||
> `email`: string
|
||||
|
||||
邮件地址,用于标识用户。如果对接服务端需要认证则选填,否则不要包含此项。
|
||||
|
||||
> `headers`: map{ string, string }
|
||||
|
||||
HTTP 头,一个键值对,每个键表示一个 HTTP 头的名称,每次请求会附上所有的键值对。
|
||||
|
||||
@@ -29,29 +29,6 @@ Shadowsocks 2022 新协议格式提升了性能并带有完整的重放保护,
|
||||
|
||||
## OutboundConfigurationObject
|
||||
|
||||
```json
|
||||
{
|
||||
"servers": [
|
||||
{
|
||||
"email": "love@xray.com",
|
||||
"address": "127.0.0.1",
|
||||
"port": 1234,
|
||||
"method": "加密方式",
|
||||
"password": "密码",
|
||||
"uot": true,
|
||||
"UoTVersion": 2,
|
||||
"level": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
> `servers`: \[[ServerObject](#serverobject)\]
|
||||
|
||||
一个数组,代表一组 Shadowsocks 服务端设置, 其中每一项是一个 [ServerObject](#serverobject)。
|
||||
|
||||
### ServerObject
|
||||
|
||||
```json
|
||||
{
|
||||
"email": "love@xray.com",
|
||||
@@ -79,11 +56,11 @@ Shadowsocks 服务端端口。必填。
|
||||
|
||||
> `method`: string
|
||||
|
||||
必填。
|
||||
Shadowsocks 加密方式,必填。
|
||||
|
||||
> `password`: string
|
||||
|
||||
必填。
|
||||
Shadowsocks 认证密码,必填。
|
||||
|
||||
> `uot`: bool
|
||||
|
||||
|
||||
@@ -8,41 +8,14 @@
|
||||
|
||||
## OutboundConfigurationObject
|
||||
|
||||
```json
|
||||
{
|
||||
"servers": [
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"port": 1234,
|
||||
"users": [
|
||||
{
|
||||
"user": "test user",
|
||||
"pass": "test pass",
|
||||
"level": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
> `servers`: \[ [ServerObject](#serverobject) \]
|
||||
|
||||
Socks 服务器列表,其中每一项是一个服务器配置。
|
||||
|
||||
### ServerObject
|
||||
|
||||
```json
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"port": 1234,
|
||||
"users": [
|
||||
{
|
||||
"user": "test user",
|
||||
"pass": "test pass",
|
||||
"level": 0
|
||||
}
|
||||
]
|
||||
"user": "test user",
|
||||
"pass": "test pass",
|
||||
"level": 0,
|
||||
"email": "love@xray.com"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -56,36 +29,22 @@ Socks 服务器列表,其中每一项是一个服务器配置。
|
||||
|
||||
> `port`: number
|
||||
|
||||
服务器端口, 必填
|
||||
|
||||
> `users`: \[ [UserObject](#userobject) \]
|
||||
|
||||
一个数组表示的用户列表,数组中每个元素为一个用户配置。
|
||||
|
||||
当列表不为空时,Socks 客户端会使用用户信息进行认证;如未指定,则不进行认证。
|
||||
|
||||
默认值为空。
|
||||
|
||||
#### UserObject
|
||||
|
||||
```json
|
||||
{
|
||||
"user": "test user",
|
||||
"pass": "test pass",
|
||||
"level": 0
|
||||
}
|
||||
```
|
||||
服务器端口, 必填。
|
||||
|
||||
> `user`: string
|
||||
|
||||
用户名,字符串类型。必填。
|
||||
用户名,字符串类型。如果对接服务端需要认证则必填,否则不要包含此项。
|
||||
|
||||
> `pass`: string
|
||||
|
||||
密码,字符串类型。必填。
|
||||
密码,字符串类型。如果对接服务端需要认证则必填,否则不要包含此项。
|
||||
|
||||
> `level`: number
|
||||
|
||||
用户等级,连接会使用这个用户等级对应的 [本地策略](../policy.md#levelpolicyobject)。
|
||||
用户等级,连接会使用这个用户等级对应的 [本地策略](../policy.md#levelpolicyobject)。如果对接服务端需要认证则选填,否则不要包含此项。
|
||||
|
||||
userLevel 的值, 对应 [policy](../policy.md#policyobject) 中 `level` 的值。 如不指定, 默认为 0。
|
||||
|
||||
> `email`: string
|
||||
|
||||
邮件地址,用于标识用户。如果对接服务端需要认证则选填,否则不要包含此项。
|
||||
|
||||
@@ -8,26 +8,6 @@ Trojan 被设计工作在正确配置的加密 TLS 隧道
|
||||
|
||||
## OutboundConfigurationObject
|
||||
|
||||
```json
|
||||
{
|
||||
"servers": [
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"port": 1234,
|
||||
"password": "password",
|
||||
"email": "love@xray.com",
|
||||
"level": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
> `servers`: \[ [ServerObject](#serverobject) \]
|
||||
|
||||
一个数组,其中每一项是一个 [ServerObject](#serverobject)。
|
||||
|
||||
### ServerObject
|
||||
|
||||
```json
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
|
||||
@@ -6,44 +6,15 @@ VLESS 是一个无状态的轻量传输协议,它分为入站和出站两部
|
||||
|
||||
## OutboundConfigurationObject
|
||||
|
||||
```json
|
||||
{
|
||||
"vnext": [
|
||||
{
|
||||
"address": "example.com",
|
||||
"port": 443,
|
||||
"users": [
|
||||
{
|
||||
"id": "5783a3e7-e373-51cd-8642-c83782b807c5",
|
||||
"encryption": "none",
|
||||
"flow": "xtls-rprx-vision",
|
||||
"level": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
> `vnext`: \[ [ServerObject](#serverobject) \]
|
||||
|
||||
一个数组, 表示 VLESS 服务器列表,包含一组指向服务端的配置, 其中每一项是一个服务器配置。
|
||||
|
||||
### ServerObject
|
||||
|
||||
```json
|
||||
{
|
||||
"address": "example.com",
|
||||
"port": 443,
|
||||
"users": [
|
||||
{
|
||||
"id": "5783a3e7-e373-51cd-8642-c83782b807c5",
|
||||
"encryption": "none",
|
||||
"flow": "xtls-rprx-vision",
|
||||
"level": 0,
|
||||
"reverse": {}
|
||||
}
|
||||
]
|
||||
"id": "5783a3e7-e373-51cd-8642-c83782b807c5",
|
||||
"encryption": "none",
|
||||
"flow": "xtls-rprx-vision",
|
||||
"level": 0,
|
||||
"reverse": {}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -55,22 +26,6 @@ VLESS 是一个无状态的轻量传输协议,它分为入站和出站两部
|
||||
|
||||
服务端端口,通常与服务端监听的端口相同。
|
||||
|
||||
> `users`: \[ [UserObject](#userobject) \]
|
||||
|
||||
数组, 一组服务端认可的用户列表, 其中每一项是一个用户配置
|
||||
|
||||
### UserObject
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "5783a3e7-e373-51cd-8642-c83782b807c5",
|
||||
"encryption": "none",
|
||||
"flow": "xtls-rprx-vision",
|
||||
"level": 0,
|
||||
"reverse" {}
|
||||
}
|
||||
```
|
||||
|
||||
> `id`: string
|
||||
|
||||
VLESS 的用户 ID,可以是任意小于 30 字节的字符串, 也可以是一个合法的 UUID.
|
||||
@@ -95,10 +50,10 @@ VLESS 的用户 ID,可以是任意小于 30 字节的字符串, 也可以是
|
||||
- 第2个块为加密方式,可选 `native`/`xorpub`/`random`, 分别对应: 原始格式数据包/原始格式+混淆公钥部分/全随机数(类似 VMESS/Shadows socks)。要求服务端与客户端一致
|
||||
- 第3个块为是否会话恢复。选择 `0rtt` 将跟随服务端设置尝试使用先前生成的票据跳过握手快速连接(可被服务端手动禁用),选择 `1rtt` 将强制执行 1RTT 的握手过程。此处与服务端设置含义不同,详见 VLESS 入站 `decryption` 设置。
|
||||
|
||||
往后为 padding, 连接建立后客户端发送一些垃圾数据用以混淆长度特征,无需与服务端相同(入站的相同部分为服务端向客户端方向发送的 padding),属于可变长部分,格式为 `padding.delay.padding`+`(.delay.padding)`*n(可插入多个 padding, 要求两个 padding 块之间必须包含一个 delay 块) 比如可以写一个超长的 `padding.delay.padding.delay.padding.delay.padding.delay.padding.delay.padding`
|
||||
往后为 padding, 连接建立后客户端发送一些垃圾数据用以混淆长度特征,无需与服务端相同(入站的相同部分为服务端向客户端方向发送的 padding),属于可变长部分,格式为 `padding.delay.padding`+`(.delay.padding)`×n(可插入多个 padding, 要求两个 padding 块之间必须包含一个 delay 块) 比如可以写一个超长的 `padding.delay.padding.delay.padding.delay.padding.delay.padding.delay.padding`
|
||||
|
||||
-`padding` 格式为 `probability-min-max` 如 `100-111-1111` 含义为 100% 发送一个长度 111~1111 的padding.
|
||||
-`delay` 格式同样为 `probability-min-max` 如 `75-0-111` 含义为 75% 的概率等待 0~111 毫秒
|
||||
- `padding` 格式为 `probability-min-max` 如 `100-111-1111` 含义为 100% 发送一个长度 111~1111 的padding.
|
||||
- `delay` 格式同样为 `probability-min-max` 如 `75-0-111` 含义为 75% 的概率等待 0~111 毫秒
|
||||
|
||||
第一个 padding 块存在特殊要求,要求概率为 100% 且最小长度大于 0. 若不存在任何 padding, 核心自动使用 `100-111-1111.75-0-111.50-0-3333` 作为 padding 设置。
|
||||
|
||||
@@ -160,4 +115,4 @@ VLESS 极简反向代理配置,和核心内部自带的的通用反向代理
|
||||
|
||||
`tag` 为该反向代理的入站代理 tag. 当服务端派发反向代理请求时会从使用这个 tag 的入站进入路由系统,使用路由系统将其路由到你需要的出站。
|
||||
|
||||
使用的 UUID 需要是服务端同样配置了 reverse 的 UUID(详见 VLESS 入站).
|
||||
使用的 UUID 需要是服务端同样配置了 reverse 的 UUID(详见 VLESS 入站)。
|
||||
|
||||
@@ -8,38 +8,14 @@ VMess 依赖于系统时间,请确保使用 Xray 的系统 UTC 时间误差在
|
||||
|
||||
## OutboundConfigurationObject
|
||||
|
||||
```json
|
||||
{
|
||||
"vnext": [
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"port": 37192,
|
||||
"users": [
|
||||
{
|
||||
"id": "5783a3e7-e373-51cd-8642-c83782b807c5",
|
||||
"security": "auto",
|
||||
"level": 0,
|
||||
"experiments": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
> `vnext`:\[ [ServerObject](#serverobject) \]
|
||||
|
||||
一个数组,包含一组的服务端配置.
|
||||
|
||||
其中每一项是一个服务端配置[ServerObject](#serverobject)。
|
||||
|
||||
### ServerObject
|
||||
|
||||
```json
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"port": 37192,
|
||||
"users": []
|
||||
"id": "5783a3e7-e373-51cd-8642-c83782b807c5",
|
||||
"security": "auto",
|
||||
"level": 0,
|
||||
"experiments": ""
|
||||
}
|
||||
```
|
||||
|
||||
@@ -51,23 +27,6 @@ VMess 依赖于系统时间,请确保使用 Xray 的系统 UTC 时间误差在
|
||||
|
||||
服务端监听的端口号, 必填。
|
||||
|
||||
> `users`: \[ [UserObject](#userobject) \]
|
||||
|
||||
一个数组,代表一组服务端认可的用户.
|
||||
|
||||
其中每一项是一个用户[UserObject](#userobject)。
|
||||
|
||||
#### UserObject
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "5783a3e7-e373-51cd-8642-c83782b807c5",
|
||||
"security": "auto",
|
||||
"level": 0,
|
||||
"experiments": ""
|
||||
}
|
||||
```
|
||||
|
||||
> `id`:string
|
||||
|
||||
Vmess 的用户 ID,可以是任意小于 30 字节的字符串, 也可以是一个合法的 UUID.
|
||||
@@ -107,4 +66,4 @@ level 的值, 对应 [policy](../policy.md#policyobject) 中 `level` 的值。
|
||||
|
||||
"AuthenticatedLength" 启用认证的数据包长度实验。此实验需要同时在客户端与服务器端同时开启,并运行相同版本的程序。
|
||||
|
||||
"NoTerminationSignal" 启用不发送断开连接标致实验。此实验可能会影响被代理的连接的稳定性。
|
||||
"NoTerminationSignal" 启用不发送断开连接标志。该特性现默认启用。
|
||||
|
||||
@@ -35,13 +35,13 @@ go env -w GOPROXY=https://goproxy.io,direct
|
||||
|
||||
```powershell
|
||||
$env:CGO_ENABLED=0
|
||||
go build -o xray.exe -trimpath -ldflags "-s -w -buildid=" ./main
|
||||
go build -o xray.exe -trimpath -buildvcs=false -ldflags "-s -w -buildid=" ./main
|
||||
```
|
||||
|
||||
### macOS, Linux:
|
||||
|
||||
```bash
|
||||
CGO_ENABLED=0 go build -o xray -trimpath -ldflags "-s -w -buildid=" ./main
|
||||
CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -ldflags "-s -w -buildid=" ./main
|
||||
```
|
||||
|
||||
运行以上命令会在目录下生成 xray 可执行文件。
|
||||
@@ -63,7 +63,7 @@ $env:CGO_ENABLED=0
|
||||
$env:GOOS="linux"
|
||||
$env:GOARCH="amd64"
|
||||
|
||||
go build -o xray -trimpath -ldflags "-s -w -buildid=" ./main
|
||||
go build -o xray -trimpath -buildvcs=false -ldflags "-s -w -buildid=" ./main
|
||||
```
|
||||
|
||||
上传到服务器后,记得在服务器终端内执行 `chmod +x xray`
|
||||
@@ -74,8 +74,22 @@ go build -o xray -trimpath -ldflags "-s -w -buildid=" ./main
|
||||
|
||||
## 可复现构建:
|
||||
|
||||
按照上述步骤,能够编译与 Release 中完全相同的二进制文件。
|
||||
使用以下命令进行构建(`<short commit ID>` 应替换为对应的提交 SHA-256 前七位):
|
||||
|
||||
```bash
|
||||
CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=<short commit ID> -s -w -buildid=" -v ./main
|
||||
```
|
||||
|
||||
其中对 MIPS/MIPSLE 架构,应该使用:
|
||||
|
||||
```bash
|
||||
CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -gcflags="-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=<short commit ID> -s -w -buildid=" -v ./main
|
||||
```
|
||||
|
||||
::: warning
|
||||
请先确认您使用的 Golang 版本与编译 Release 的一致。
|
||||
:::
|
||||
|
||||
## 编译用于 Windows 7 的版本
|
||||
|
||||
将 Golang 工具替换为 [go-win7](https://github.com/XTLS/go-win7) 中提供的版本,再安装上述步骤进行编译。
|
||||
|
||||
@@ -22,9 +22,12 @@ The commands are:
|
||||
api Call an API in an Xray process
|
||||
convert Convert configs
|
||||
tls TLS tools
|
||||
uuid Generate UUIDv4 or UUIDv5
|
||||
x25519 Generate key pair for x25519 key exchange
|
||||
wg Generate key pair for wireguard key exchange
|
||||
uuid Generate UUIDv4 or UUIDv5 (VLESS)
|
||||
x25519 Generate key pair for X25519 key exchange (REALITY, VLESS Encryption)
|
||||
wg Generate key pair for X25519 key exchange (WireGuard)
|
||||
mldsa65 Generate key pair for ML-DSA-65 post-quantum signature (REALITY)
|
||||
mlkem768 Generate key pair for ML-KEM-768 post-quantum key exchange (VLESS Encryption)
|
||||
vlessenc Generate decryption/encryption json pair (VLESS Encryption)
|
||||
|
||||
Use "xray help <command>" for more information about a command.
|
||||
```
|
||||
@@ -65,6 +68,13 @@ The -dump flag tells Xray to print the merged config.
|
||||
配置文件除了默认的 JSON 格式外,也可以使用 TOML 和 YAML。在不指定格式的前提下会通过文件扩展名识别。
|
||||
:::
|
||||
|
||||
::: tip
|
||||
当 `-config` 没有指定时,Xray 将先后尝试从以下路径加载 `config.json` :
|
||||
|
||||
- 工作目录(Working Directory)
|
||||
- [环境变量](../config/features/env.md#资源文件路径)中 `Xray.location.asset` 所指定的路径
|
||||
:::
|
||||
|
||||
```
|
||||
xray run -dump
|
||||
```
|
||||
@@ -120,10 +130,10 @@ The commands are:
|
||||
`pb` 子命令使用示例:
|
||||
|
||||
```bash
|
||||
# 用法:xray convert pb [-debug] [-type] [json file] [json file] ...
|
||||
# 用法:xray convert pb [-outpbfile out.pb] [-debug] [-type] [json file] [json file] ...
|
||||
|
||||
# 把三个配置合并成 mix.pb
|
||||
xray convert pb c1.json c2.json c3.json > mix.pb
|
||||
xray convert pb -outpbfile mix.pb c1.json c2.json c3.json
|
||||
|
||||
# 使用 -debug 选项查看 mix.pb 的内容
|
||||
xray convert pb -debug mix.pb
|
||||
@@ -209,3 +219,33 @@ xray wg [-i "(base64.StdEncoding)"]
|
||||
- 工作目录(Working Directory)
|
||||
- [环境变量](../config/features/env.md#资源文件路径)中 `Xray.location.asset` 所指定的路径
|
||||
:::
|
||||
|
||||
### xray mldsa65
|
||||
|
||||
生成用于 REALITY 的 MLDSA-65 后量子签名密钥对。
|
||||
|
||||
使用方法:
|
||||
|
||||
```
|
||||
xray mldsa65 [-i "seed (base64.StdEncoding)"]
|
||||
```
|
||||
|
||||
### xray mlkem768
|
||||
|
||||
生成用于 VLESS Encryption 的 ML-KEM-768 后量子密钥交换用密钥对。
|
||||
|
||||
使用方法:
|
||||
|
||||
```
|
||||
xray mlkem768 [-i "seed (base64.StdEncoding)"]
|
||||
```
|
||||
|
||||
### xray vlessenc
|
||||
|
||||
生成可以直接用于 VLESS Encryption 的 encryption/decryption 选项内容。生成配置中 X25519 以及 ML-KEM-768 两种认证方式选一种使用即可,但是服务端及客户端必须采用同一种认证方式。临时密钥交换仍后量子安全,不受认证方式影响。
|
||||
|
||||
使用方法:
|
||||
|
||||
```
|
||||
xray vlessenc
|
||||
```
|
||||
|
||||
@@ -6,6 +6,7 @@ Xray 在以下平台中可用:
|
||||
|
||||
- Windows 7 及之后版本(x86 / amd64 / arm32 / arm64);
|
||||
- Windows 7 中使用 1.8.4、1.8.6 的常规版本以及 1.8.18 以后的 `win7` 版本需要系统安装有 **KB4474419** 更新方可使用;推荐同时安装 KB4490628 以便联网后接受后续的操作系统安全更新。
|
||||
- 从 v25 开始,在 Windows 7 上运行 `win7` 版本只需安装 SP1 即可正常运行,但对联网系统而言仍然强烈建议安装后续操作系统安全更新。
|
||||
- macOS 10.10 Yosemite 及之后版本(amd64 / arm64);
|
||||
- Linux 2.6.23 及之后版本(x86 / amd64 / arm / arm64 / mips64 / mips / ppc64 / s390x / riscv64);
|
||||
- 包括但不限于 Debian 7 / 8、Ubuntu 12.04 / 14.04 及后续版本、CentOS 7 / 8、Arch Linux 等;
|
||||
@@ -126,25 +127,41 @@ ghcr.io/xtls/xray-core 版本映像:
|
||||
- [PassWall](https://github.com/xiaorouji/openwrt-passwall), [PassWall 2](https://github.com/xiaorouji/openwrt-passwall2)
|
||||
- [ShadowSocksR Plus+](https://github.com/fw876/helloworld)
|
||||
- [luci-app-xray](https://github.com/yichya/luci-app-xray) ([openwrt-xray](https://github.com/yichya/openwrt-xray))
|
||||
- Asuswrt-Merlin
|
||||
- [XRAYUI](https://github.com/DanielLavrushin/asuswrt-merlin-xrayui)
|
||||
- Windows
|
||||
- [v2rayA](https://github.com/v2rayA/v2rayA)
|
||||
- [v2rayN](https://github.com/2dust/v2rayN)
|
||||
- [Furious](https://github.com/LorenEteval/Furious)
|
||||
- [Invisible Man - Xray](https://github.com/InvisibleManVPN/InvisibleMan-XRayClient)
|
||||
- [AnyPortal](https://github.com/AnyPortal/AnyPortal)
|
||||
- Android
|
||||
- [v2rayNG](https://github.com/2dust/v2rayNG)
|
||||
- [X-flutter](https://github.com/XTLS/X-flutter)
|
||||
- [SaeedDev94/Xray](https://github.com/SaeedDev94/Xray)
|
||||
- iOS & macOS arm64
|
||||
- [SimpleXray](https://github.com/lhear/SimpleXray)
|
||||
- [AnyPortal](https://github.com/AnyPortal/AnyPortal)
|
||||
- iOS & macOS arm64 & tvOS
|
||||
- [Happ](https://apps.apple.com/app/happ-proxy-utility/id6504287215) ([tvOS](https://apps.apple.com/us/app/happ-proxy-utility-for-tv/id6748297274))
|
||||
- [FoXray](https://apps.apple.com/app/foxray/id6448898396)
|
||||
- [Streisand](https://apps.apple.com/app/streisand/id6450534064)
|
||||
- macOS arm64 & x64
|
||||
- [Happ](https://apps.apple.com/app/happ-proxy-utility/id6504287215)
|
||||
- [v2rayA](https://github.com/v2rayA/v2rayA)
|
||||
- [v2rayN](https://github.com/2dust/v2rayN)
|
||||
- [V2rayU](https://github.com/yanue/V2rayU)
|
||||
- [V2RayXS](https://github.com/tzmax/V2RayXS)
|
||||
- [Furious](https://github.com/LorenEteval/Furious)
|
||||
- [FoXray](https://apps.apple.com/app/foxray/id6448898396)
|
||||
- [OneXray](https://github.com/OneXray/OneXray)
|
||||
- [GoXRay](https://github.com/goxray/desktop)
|
||||
- [AnyPortal](https://github.com/AnyPortal/AnyPortal)
|
||||
- Linux
|
||||
- [v2rayA](https://github.com/v2rayA/v2rayA)
|
||||
- [v2rayN](https://github.com/2dust/v2rayN)
|
||||
- [Furious](https://github.com/LorenEteval/Furious)
|
||||
- [GorzRay](https://github.com/ketetefid/GorzRay)
|
||||
- [GoXRay](https://github.com/goxray/desktop)
|
||||
- [AnyPortal](https://github.com/AnyPortal/AnyPortal)
|
||||
|
||||
# UUID 生成器
|
||||
|
||||
|
||||
Reference in New Issue
Block a user