Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 1 addition & 35 deletions docs/config/inbound.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
"sniffing": {
"enabled": true,
"destOverride": ["http", "tls"]
},
"allocate": {
"strategy": "always",
"refresh": 5,
"concurrency": 3
}
}
]
Expand Down Expand Up @@ -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 进行重定向而不是在这里设置。

Expand Down Expand Up @@ -92,10 +87,6 @@

当设置了 sniffing 中的 enable 为 true, 还能嗅探出 bittorrent 类型的流量, 然后可以在路由中配置"protocol"项来设置规则处理 BT 流量, 比如服务端用来拦截 BT 流量, 或客户端固定转发 BT 流量到某个 VPS 去等.

> `allocate`: [AllocateObject](#allocateobject)

当设置了多个 port 时, 端口分配的具体设置

### SniffingObject

```json
Expand Down Expand Up @@ -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 changes: 0 additions & 19 deletions docs/config/inbounds/vmess.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ VMess 依赖于系统时间,请确保使用 Xray 的系统 UTC 时间误差在
],
"default": {
"level": 0
},
"detour": {
"to": "tag_to_detour"
}
}
```
Expand All @@ -34,10 +31,6 @@ VMess 依赖于系统时间,请确保使用 Xray 的系统 UTC 时间误差在

当此配置用作动态端口时,Xray 会自动创建用户。

> `detour`: [DetourObject](#detourobject)

指示对应的出站协议使用另一个服务器。

> `default`: [DefaultObject](#defaultobject)

可选,clients 的默认配置。仅在配合`detour`时有效。
Expand Down Expand Up @@ -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
Expand Down
68 changes: 20 additions & 48 deletions docs/config/outbounds/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -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": "[email protected]",
"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"
Expand All @@ -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 代理服务器地址,必填。
Expand All @@ -68,23 +39,24 @@ HTTP 代理服务器地址,必填。

HTTP 代理服务器端口,必填。

> `user`: \[[AccountObject](#accountobject)\]
> `user`: string

一个数组,数组中每个元素为一个用户帐号。默认值为空
用户名,字符串类型。如果对接服务端需要认证则必填,否则不要包含此项

#### AccountObject
> `pass`: string

```json
{
"user": "my-username",
"pass": "my-password"
}
```
密码,字符串类型。如果对接服务端需要认证则必填,否则不要包含此项。

> `user`: string
> `level`: number

用户名,字符串类型。必填
用户等级,连接会使用这个用户等级对应的 [本地策略](../policy.md#levelpolicyobject)。如果对接服务端需要认证则选填,否则不要包含此项

> `pass`: string
userLevel 的值, 对应 [policy](../policy.md#policyobject) 中 `level` 的值。 如不指定, 默认为 0。

> `email`: string

邮件地址,用于标识用户。如果对接服务端需要认证则选填,否则不要包含此项。

> `headers`: map{ string, string }

密码,字符串类型。必填
HTTP 头,一个键值对,每个键表示一个 HTTP 头的名称,每次请求会附上所有的键值对
27 changes: 2 additions & 25 deletions docs/config/outbounds/shadowsocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,6 @@ Shadowsocks 2022 新协议格式提升了性能并带有完整的重放保护,

## OutboundConfigurationObject

```json
{
"servers": [
{
"email": "[email protected]",
"address": "127.0.0.1",
"port": 1234,
"method": "加密方式",
"password": "密码",
"uot": true,
"UoTVersion": 2,
"level": 0
}
]
}
```

> `servers`: \[[ServerObject](#serverobject)\]

一个数组,代表一组 Shadowsocks 服务端设置, 其中每一项是一个 [ServerObject](#serverobject)。

### ServerObject

```json
{
"email": "[email protected]",
Expand Down Expand Up @@ -79,11 +56,11 @@ Shadowsocks 服务端端口。必填。

> `method`: string

必填。
Shadowsocks 加密方式,必填。

> `password`: string

必填。
Shadowsocks 认证密码,必填。

> `uot`: bool

Expand Down
65 changes: 12 additions & 53 deletions docs/config/outbounds/socks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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": "[email protected]"
}
```

Expand All @@ -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

邮件地址,用于标识用户。如果对接服务端需要认证则选填,否则不要包含此项。
20 changes: 0 additions & 20 deletions docs/config/outbounds/trojan.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,6 @@ Trojan 被设计工作在正确配置的加密 TLS 隧道

## OutboundConfigurationObject

```json
{
"servers": [
{
"address": "127.0.0.1",
"port": 1234,
"password": "password",
"email": "[email protected]",
"level": 0
}
]
}
```

> `servers`: \[ [ServerObject](#serverobject) \]

一个数组,其中每一项是一个 [ServerObject](#serverobject)。

### ServerObject

```json
{
"address": "127.0.0.1",
Expand Down
Loading