mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-22 16:41:30 +00:00
documentation: Add TUIC
This commit is contained in:
parent
917420e79a
commit
ce4c76cdd2
82
docs/configuration/inbound/tuic.md
Normal file
82
docs/configuration/inbound/tuic.md
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
### Structure
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "tuic",
|
||||||
|
"tag": "tuic-in",
|
||||||
|
|
||||||
|
... // Listen Fields
|
||||||
|
|
||||||
|
"users": [
|
||||||
|
{
|
||||||
|
"name": "sekai",
|
||||||
|
"uuid": "059032A9-7D40-4A96-9BB1-36823D848068",
|
||||||
|
"password": "hello"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"congestion_control": "cubic",
|
||||||
|
"auth_timeout": "3s",
|
||||||
|
"zero_rtt_handshake": false,
|
||||||
|
"heartbeat": "10s",
|
||||||
|
"tls": {}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! warning ""
|
||||||
|
|
||||||
|
QUIC, which is required by TUIC is not included by default, see [Installation](/#installation).
|
||||||
|
|
||||||
|
### Listen Fields
|
||||||
|
|
||||||
|
See [Listen Fields](/configuration/shared/listen) for details.
|
||||||
|
|
||||||
|
### Fields
|
||||||
|
|
||||||
|
#### users
|
||||||
|
|
||||||
|
TUIC users
|
||||||
|
|
||||||
|
#### users.uuid
|
||||||
|
|
||||||
|
==Required==
|
||||||
|
|
||||||
|
TUIC user uuid
|
||||||
|
|
||||||
|
#### users.password
|
||||||
|
|
||||||
|
TUIC user password
|
||||||
|
|
||||||
|
#### congestion_control
|
||||||
|
|
||||||
|
QUIC congestion control algorithm
|
||||||
|
|
||||||
|
One of: `cubic`, `new_reno`, `bbr`
|
||||||
|
|
||||||
|
`cubic` is used by default.
|
||||||
|
|
||||||
|
#### auth_timeout
|
||||||
|
|
||||||
|
How long the server should wait for the client to send the authentication command
|
||||||
|
|
||||||
|
`3s` is used by default.
|
||||||
|
|
||||||
|
#### zero_rtt_handshake
|
||||||
|
|
||||||
|
Enable 0-RTT QUIC connection handshake on the client side
|
||||||
|
This is not impacting much on the performance, as the protocol is fully multiplexed
|
||||||
|
|
||||||
|
!!! warning ""
|
||||||
|
Disabling this is highly recommended, as it is vulnerable to replay attacks.
|
||||||
|
See [Attack of the clones](https://blog.cloudflare.com/even-faster-connection-establishment-with-quic-0-rtt-resumption/#attack-of-the-clones)
|
||||||
|
|
||||||
|
#### heartbeat
|
||||||
|
|
||||||
|
Interval for sending heartbeat packets for keeping the connection alive
|
||||||
|
|
||||||
|
`10s` is used by default.
|
||||||
|
|
||||||
|
#### tls
|
||||||
|
|
||||||
|
==Required==
|
||||||
|
|
||||||
|
TLS configuration, see [TLS](/configuration/shared/tls/#inbound).
|
82
docs/configuration/inbound/tuic.zh.md
Normal file
82
docs/configuration/inbound/tuic.zh.md
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
### 结构
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "tuic",
|
||||||
|
"tag": "tuic-in",
|
||||||
|
|
||||||
|
... // 监听字段
|
||||||
|
|
||||||
|
"users": [
|
||||||
|
{
|
||||||
|
"name": "sekai",
|
||||||
|
"uuid": "059032A9-7D40-4A96-9BB1-36823D848068",
|
||||||
|
"password": "hello"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"congestion_control": "cubic",
|
||||||
|
"auth_timeout": "3s",
|
||||||
|
"zero_rtt_handshake": false,
|
||||||
|
"heartbeat": "10s",
|
||||||
|
"tls": {}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! warning ""
|
||||||
|
|
||||||
|
默认安装不包含被 TUI 依赖的 QUIC,参阅 [安装](/zh/#_2)。
|
||||||
|
|
||||||
|
### 监听字段
|
||||||
|
|
||||||
|
参阅 [监听字段](/zh/configuration/shared/listen/)。
|
||||||
|
|
||||||
|
### 字段
|
||||||
|
|
||||||
|
#### users
|
||||||
|
|
||||||
|
TUIC 用户
|
||||||
|
|
||||||
|
#### users.uuid
|
||||||
|
|
||||||
|
==必填==
|
||||||
|
|
||||||
|
TUIC 用户 UUID
|
||||||
|
|
||||||
|
#### users.password
|
||||||
|
|
||||||
|
TUIC 用户密码
|
||||||
|
|
||||||
|
#### congestion_control
|
||||||
|
|
||||||
|
QUIC 流量控制算法
|
||||||
|
|
||||||
|
可选值: `cubic`, `new_reno`, `bbr`
|
||||||
|
|
||||||
|
默认使用 `cubic`。
|
||||||
|
|
||||||
|
#### auth_timeout
|
||||||
|
|
||||||
|
服务器等待客户端发送认证命令的时间
|
||||||
|
|
||||||
|
默认使用 `3s`。
|
||||||
|
|
||||||
|
#### zero_rtt_handshake
|
||||||
|
|
||||||
|
在客户端启用 0-RTT QUIC 连接握手
|
||||||
|
这对性能影响不大,因为协议是完全复用的
|
||||||
|
|
||||||
|
!!! warning ""
|
||||||
|
强烈建议禁用此功能,因为它容易受到重放攻击。
|
||||||
|
请参阅 [Attack of the clones](https://blog.cloudflare.com/even-faster-connection-establishment-with-quic-0-rtt-resumption/#attack-of-the-clones)
|
||||||
|
|
||||||
|
#### heartbeat
|
||||||
|
|
||||||
|
发送心跳包以保持连接存活的时间间隔
|
||||||
|
|
||||||
|
默认使用 `10s`。
|
||||||
|
|
||||||
|
#### tls
|
||||||
|
|
||||||
|
==必填==
|
||||||
|
|
||||||
|
TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
|
|
@ -97,12 +97,6 @@ Disables Path MTU Discovery (RFC 8899). Packets will then be at most 1252 (IPv4)
|
||||||
|
|
||||||
Force enabled on for systems other than Linux and Windows (according to upstream).
|
Force enabled on for systems other than Linux and Windows (according to upstream).
|
||||||
|
|
||||||
#### tls
|
|
||||||
|
|
||||||
==Required==
|
|
||||||
|
|
||||||
TLS configuration, see [TLS](/configuration/shared/tls/#outbound).
|
|
||||||
|
|
||||||
#### network
|
#### network
|
||||||
|
|
||||||
Enabled network
|
Enabled network
|
||||||
|
@ -111,6 +105,12 @@ One of `tcp` `udp`.
|
||||||
|
|
||||||
Both is enabled by default.
|
Both is enabled by default.
|
||||||
|
|
||||||
|
#### tls
|
||||||
|
|
||||||
|
==Required==
|
||||||
|
|
||||||
|
TLS configuration, see [TLS](/configuration/shared/tls/#outbound).
|
||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
See [Dial Fields](/configuration/shared/dial) for details.
|
See [Dial Fields](/configuration/shared/dial) for details.
|
||||||
|
|
|
@ -97,10 +97,6 @@ base64 编码的认证密码。
|
||||||
|
|
||||||
强制为 Linux 和 Windows 以外的系统启用(根据上游)。
|
强制为 Linux 和 Windows 以外的系统启用(根据上游)。
|
||||||
|
|
||||||
==必填==
|
|
||||||
|
|
||||||
TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#outbound)。
|
|
||||||
|
|
||||||
#### network
|
#### network
|
||||||
|
|
||||||
启用的网络协议。
|
启用的网络协议。
|
||||||
|
@ -109,6 +105,13 @@ TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#outbound)。
|
||||||
|
|
||||||
默认所有。
|
默认所有。
|
||||||
|
|
||||||
|
#### tls
|
||||||
|
|
||||||
|
==必填==
|
||||||
|
|
||||||
|
TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#outbound)。
|
||||||
|
|
||||||
|
|
||||||
### 拨号字段
|
### 拨号字段
|
||||||
|
|
||||||
参阅 [拨号字段](/zh/configuration/shared/dial/)。
|
参阅 [拨号字段](/zh/configuration/shared/dial/)。
|
||||||
|
|
86
docs/configuration/outbound/tuic.md
Normal file
86
docs/configuration/outbound/tuic.md
Normal file
|
@ -0,0 +1,86 @@
|
||||||
|
### Structure
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "tuic",
|
||||||
|
"tag": "tuic-out",
|
||||||
|
|
||||||
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 1080,
|
||||||
|
"uuid": "2DD61D93-75D8-4DA4-AC0E-6AECE7EAC365",
|
||||||
|
"password": "hello",
|
||||||
|
"congestion_control": "cubic",
|
||||||
|
"udp_relay_mode": "native",
|
||||||
|
"zero_rtt_handshake": false,
|
||||||
|
"heartbeat": "10s",
|
||||||
|
"network": "tcp",
|
||||||
|
"tls": {},
|
||||||
|
|
||||||
|
... // Dial Fields
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! warning ""
|
||||||
|
|
||||||
|
QUIC, which is required by TUIC is not included by default, see [Installation](/#installation).
|
||||||
|
|
||||||
|
### Fields
|
||||||
|
|
||||||
|
#### server
|
||||||
|
|
||||||
|
==Required==
|
||||||
|
|
||||||
|
The server address.
|
||||||
|
|
||||||
|
#### server_port
|
||||||
|
|
||||||
|
==Required==
|
||||||
|
|
||||||
|
The server port.
|
||||||
|
|
||||||
|
#### uuid
|
||||||
|
|
||||||
|
==Required==
|
||||||
|
|
||||||
|
TUIC user uuid
|
||||||
|
|
||||||
|
#### password
|
||||||
|
|
||||||
|
TUIC user password
|
||||||
|
|
||||||
|
#### congestion_control
|
||||||
|
|
||||||
|
QUIC congestion control algorithm
|
||||||
|
|
||||||
|
One of: `cubic`, `new_reno`, `bbr`
|
||||||
|
|
||||||
|
`cubic` is used by default.
|
||||||
|
|
||||||
|
#### udp_relay_mode
|
||||||
|
|
||||||
|
UDP packet relay mode
|
||||||
|
|
||||||
|
| Mode | Description |
|
||||||
|
|:-------|:-------------------------------------------------------------------------|
|
||||||
|
| native | native UDP characteristics |
|
||||||
|
| quic | lossless UDP relay using QUIC streams, additional overhead is introduced |
|
||||||
|
|
||||||
|
`native` is used by default.
|
||||||
|
|
||||||
|
#### network
|
||||||
|
|
||||||
|
Enabled network
|
||||||
|
|
||||||
|
One of `tcp` `udp`.
|
||||||
|
|
||||||
|
Both is enabled by default.
|
||||||
|
|
||||||
|
#### tls
|
||||||
|
|
||||||
|
==Required==
|
||||||
|
|
||||||
|
TLS configuration, see [TLS](/configuration/shared/tls/#outbound).
|
||||||
|
|
||||||
|
### Dial Fields
|
||||||
|
|
||||||
|
See [Dial Fields](/configuration/shared/dial) for details.
|
98
docs/configuration/outbound/tuic.zh.md
Normal file
98
docs/configuration/outbound/tuic.zh.md
Normal file
|
@ -0,0 +1,98 @@
|
||||||
|
### 结构
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "tuic",
|
||||||
|
"tag": "tuic-out",
|
||||||
|
|
||||||
|
"server": "127.0.0.1",
|
||||||
|
"server_port": 1080,
|
||||||
|
"uuid": "2DD61D93-75D8-4DA4-AC0E-6AECE7EAC365",
|
||||||
|
"password": "hello",
|
||||||
|
"congestion_control": "cubic",
|
||||||
|
"udp_relay_mode": "native",
|
||||||
|
"zero_rtt_handshake": false,
|
||||||
|
"heartbeat": "10s",
|
||||||
|
"network": "tcp",
|
||||||
|
"tls": {},
|
||||||
|
|
||||||
|
... // 拨号字段
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! warning ""
|
||||||
|
|
||||||
|
默认安装不包含被 TUI 依赖的 QUIC,参阅 [安装](/zh/#_2)。
|
||||||
|
|
||||||
|
### 字段
|
||||||
|
|
||||||
|
#### server
|
||||||
|
|
||||||
|
==必填==
|
||||||
|
|
||||||
|
服务器地址。
|
||||||
|
|
||||||
|
#### server_port
|
||||||
|
|
||||||
|
==必填==
|
||||||
|
|
||||||
|
服务器端口。
|
||||||
|
|
||||||
|
#### uuid
|
||||||
|
|
||||||
|
==必填==
|
||||||
|
|
||||||
|
TUIC 用户 UUID
|
||||||
|
|
||||||
|
#### password
|
||||||
|
|
||||||
|
TUIC 用户密码
|
||||||
|
|
||||||
|
#### congestion_control
|
||||||
|
|
||||||
|
QUIC 流量控制算法
|
||||||
|
|
||||||
|
可选值: `cubic`, `new_reno`, `bbr`
|
||||||
|
|
||||||
|
默认使用 `cubic`。
|
||||||
|
|
||||||
|
#### udp_relay_mode
|
||||||
|
|
||||||
|
UDP 包中继模式
|
||||||
|
|
||||||
|
| 模式 | 描述 |
|
||||||
|
|--------|------------------------------|
|
||||||
|
| native | 原生 UDP |
|
||||||
|
| quic | 使用 QUIC 流的无损 UDP 中继,引入了额外的开销 |
|
||||||
|
|
||||||
|
|
||||||
|
#### zero_rtt_handshake
|
||||||
|
|
||||||
|
在客户端启用 0-RTT QUIC 连接握手
|
||||||
|
这对性能影响不大,因为协议是完全复用的
|
||||||
|
|
||||||
|
!!! warning ""
|
||||||
|
强烈建议禁用此功能,因为它容易受到重放攻击。
|
||||||
|
请参阅 [Attack of the clones](https://blog.cloudflare.com/even-faster-connection-establishment-with-quic-0-rtt-resumption/#attack-of-the-clones)
|
||||||
|
|
||||||
|
#### heartbeat
|
||||||
|
|
||||||
|
发送心跳包以保持连接存活的时间间隔
|
||||||
|
|
||||||
|
#### network
|
||||||
|
|
||||||
|
启用的网络协议。
|
||||||
|
|
||||||
|
`tcp` 或 `udp`。
|
||||||
|
|
||||||
|
默认所有。
|
||||||
|
|
||||||
|
#### tls
|
||||||
|
|
||||||
|
==必填==
|
||||||
|
|
||||||
|
TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#outbound)。
|
||||||
|
|
||||||
|
### 拨号字段
|
||||||
|
|
||||||
|
参阅 [拨号字段](/zh/configuration/shared/dial/)。
|
Loading…
Reference in a new issue