Skip to content

Commit 8d04423

Browse files
committed
Update documentation
1 parent aa7e85c commit 8d04423

File tree

12 files changed

+180
-34
lines changed

12 files changed

+180
-34
lines changed

constant/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package constant
22

33
var (
4-
Version = "1.0.1"
4+
Version = "1.1-beta1"
55
Commit = ""
66
)

docs/changelog.md

+43
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,46 @@
1+
#### 1.1-beta1
2+
3+
* Add support for use with android VPNService **1**
4+
* Add tun support for WireGuard outbound **2**
5+
* Add system tun stack **3**
6+
* Add comment filter for config **4**
7+
* Add option for allow optional proxy protocol header
8+
* Add half close for smux
9+
* Set UDP DF by default **5**
10+
* Set default tun mtu to 9000
11+
* Update gVisor to 20220905.0
12+
13+
*1*:
14+
15+
In previous versions, Android VPN would not work with tun enabled.
16+
17+
The usage of tun over VPN and VPN over tun is now supported, see [Tun Inbound](/configuration/inbound/tun#auto_route).
18+
19+
*2*:
20+
21+
In previous releases, WireGuard outbound support was backed by the lower performance gVisor virtual interface.
22+
23+
It achieves the same performance as wireguard-go by providing automatic system interface support.
24+
25+
*3*:
26+
27+
It does not depend on gVisor and has better performance in some cases.
28+
29+
It is less compatible and may not be available in some environments.
30+
31+
*4*:
32+
33+
Annotated json configuration files are now supported.
34+
35+
*5*:
36+
37+
UDP fragmentation is now blocked by default.
38+
39+
Including shadowsocks-libev, shadowsocks-rust and quic-go all disable segmentation by default.
40+
41+
See [Dial Fields](/configuration/shared/dial#udp_fragment)
42+
and [Listen Fields](/configuration/shared/listen#udp_fragment).
43+
144
#### 1.0.1
245

346
* Fix match 4in6 address in ip_cidr

docs/configuration/inbound/tun.md

+14-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"interface_name": "tun0",
1313
"inet4_address": "172.19.0.1/30",
1414
"inet6_address": "fdfe:dcba:9876::1/128",
15-
"mtu": 1500,
15+
"mtu": 9000,
1616
"auto_route": true,
1717
"strict_route": true,
1818
"endpoint_independent_nat": false,
@@ -80,6 +80,10 @@ Set the default route to the Tun.
8080

8181
To avoid traffic loopback, set `route.auto_detect_interface` or `route.default_interface` or `outbound.bind_interface`
8282

83+
!!! note "Use with Android VPN"
84+
85+
By default, VPN takes precedence over tun. To make tun go through VPN, enable `route.override_android_vpn`.
86+
8387
#### strict_route
8488

8589
Enforce strict routing rules in Linux when `auto_route` is enabled:
@@ -92,6 +96,10 @@ not be accessible by others.
9296

9397
#### endpoint_independent_nat
9498

99+
!!! info ""
100+
101+
This item is only available on the gvisor stack, other stacks are endpoint-independent NAT by default.
102+
95103
Enable endpoint-independent NAT.
96104

97105
Performance may degrade slightly, so it is not recommended to enable on when it is not needed.
@@ -104,10 +112,11 @@ UDP NAT expiration time in seconds, default is 300 (5 minutes).
104112

105113
TCP/IP stack.
106114

107-
| Stack | Upstream | Status |
108-
|------------------|-----------------------------------------------------------------------|-------------------|
109-
| gVisor (default) | [google/gvisor](https://github.com/google/gvisor) | recommended |
110-
| LWIP | [eycorsican/go-tun2socks](https://github.com/eycorsican/go-tun2socks) | upstream archived |
115+
| Stack | Description | Status |
116+
|------------------|--------------------------------------------------------------------------------|-------------------|
117+
| gVisor (default) | Based on [google/gvisor](https://github.com/google/gvisor) | recommended |
118+
| system | Less compatibility and sometimes better performance. | recommended |
119+
| LWIP | Based on [eycorsican/go-tun2socks](https://github.com/eycorsican/go-tun2socks) | upstream archived |
111120

112121
!!! warning ""
113122

docs/configuration/inbound/tun.zh.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"interface_name": "tun0",
1313
"inet4_address": "172.19.0.1/30",
1414
"inet6_address": "fdfe:dcba:9876::1/128",
15-
"mtu": 1500,
15+
"mtu": 9000,
1616
"auto_route": true,
1717
"strict_route": true,
1818
"endpoint_independent_nat": false,
@@ -80,6 +80,10 @@ tun 接口的 IPv6 前缀。
8080

8181
为避免流量环回,请设置 `route.auto_detect_interface` 或 `route.default_interface` 或 `outbound.bind_interface`。
8282

83+
!!! note "与 Android VPN 一起使用"
84+
85+
VPN 默认优先于 tun。要使 tun 经过 VPN,启用 `route.override_android_vpn`。
86+
8387
#### strict_route
8488

8589
在 Linux 中启用 `auto_route` 时执行严格的路由规则。
@@ -103,10 +107,11 @@ UDP NAT 过期时间,以秒为单位,默认为 300(5 分钟)。
103107

104108
TCP/IP 栈。
105109

106-
|| 上游 | 状态 |
107-
|------------------|-----------------------------------------------------------------------|-------|
108-
| gVisor (default) | [google/gvisor](https://github.com/google/gvisor) | 推荐 |
109-
| LWIP | [eycorsican/go-tun2socks](https://github.com/eycorsican/go-tun2socks) | 上游已存档 |
110+
|| 描述 | 状态 |
111+
|------------------|--------------------------------------------------------------------------|-------|
112+
| gVisor (default) | 基于 [google/gvisor](https://github.com/google/gvisor) | 推荐 |
113+
| system | 兼容性较差,有时性能更好。 | 推荐 |
114+
| LWIP | 基于 [eycorsican/go-tun2socks](https://github.com/eycorsican/go-tun2socks) | 上游已存档 |
110115

111116
!!! warning ""
112117

docs/configuration/outbound/wireguard.md

+12
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
"server": "127.0.0.1",
99
"server_port": 1080,
10+
"system_interface": false,
11+
"interface_name": "wg0",
1012
"local_address": [
1113
"10.0.0.2/32"
1214
],
@@ -38,6 +40,16 @@ The server address.
3840

3941
The server port.
4042

43+
#### system_interface
44+
45+
Use system tun support.
46+
47+
Requires privileges and cannot conflict with system interfaces.
48+
49+
#### interface_name
50+
51+
Custom device name when `system_interface` enabled.
52+
4153
#### local_address
4254

4355
==Required==

docs/configuration/outbound/wireguard.zh.md

+12
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
"server": "127.0.0.1",
99
"server_port": 1080,
10+
"system_interface": false,
11+
"interface_name": "wg0",
1012
"local_address": [
1113
"10.0.0.2/32"
1214
],
@@ -38,6 +40,16 @@
3840

3941
服务器端口。
4042

43+
#### system_interface
44+
45+
使用系统 tun 支持。
46+
47+
需要特权且不能与系统接口冲突。
48+
49+
#### interface_name
50+
51+
启用 `system_interface` 时的自定义设备名称。
52+
4153
#### local_address
4254

4355
==必填==

docs/configuration/route/index.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"rules": [],
1111
"final": "",
1212
"auto_detect_interface": false,
13+
"override_android_vpn": false,
1314
"default_interface": "en0",
1415
"default_mark": 233
1516
}
@@ -34,17 +35,25 @@ Default outbound tag. the first outbound will be used if empty.
3435

3536
Only supported on Linux, Windows and macOS.
3637

37-
Bind outbound connections to the default NIC by default to prevent routing loops under Tun.
38+
Bind outbound connections to the default NIC by default to prevent routing loops under tun.
3839

3940
Takes no effect if `outbound.bind_interface` is set.
4041

42+
#### override_android_vpn
43+
44+
!!! error ""
45+
46+
Only supported on Android.
47+
48+
Accept Android VPN as upstream NIC when `auto_detect_interface` enabled.
49+
4150
#### default_interface
4251

4352
!!! error ""
4453

4554
Only supported on Linux, Windows and macOS.
4655

47-
Bind outbound connections to the specified NIC by default to prevent routing loops under Tun.
56+
Bind outbound connections to the specified NIC by default to prevent routing loops under tun.
4857

4958
Takes no effect if `auto_detect_interface` is set.
5059

docs/configuration/route/index.zh.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"rules": [],
1111
"final": "",
1212
"auto_detect_interface": false,
13+
"override_android_vpn": false,
1314
"default_interface": "en0",
1415
"default_mark": 233
1516
}
@@ -34,17 +35,25 @@
3435

3536
仅支持 Linux、Windows 和 macOS。
3637

37-
默认将出站连接绑定到默认网卡,以防止在 Tun 下出现路由环路。
38+
默认将出站连接绑定到默认网卡,以防止在 tun 下出现路由环路。
3839

3940
如果设置了 `outbound.bind_interface` 设置,则不生效。
4041

42+
#### override_android_vpn
43+
44+
!!! error ""
45+
46+
仅支持 Android。
47+
48+
启用 `auto_detect_interface` 时接受 Android VPN 作为上游网卡。
49+
4150
#### default_interface
4251

4352
!!! error ""
4453

4554
仅支持 Linux、Windows 和 macOS。
4655

47-
默认将出站连接绑定到指定网卡,以防止在 Tun 下出现路由环路。
56+
默认将出站连接绑定到指定网卡,以防止在 tun 下出现路由环路。
4857

4958
如果设置了 `auto_detect_interface` 设置,则不生效。
5059

docs/configuration/shared/dial.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@
99
"reuse_addr": false,
1010
"connect_timeout": "5s",
1111
"tcp_fast_open": false,
12+
"udp_fragment": false,
1213
"domain_strategy": "prefer_ipv6",
1314
"fallback_delay": "300ms"
1415
}
1516
```
1617

1718
### Fields
1819

19-
| Field | Available Context |
20-
|-----------------------------------------------------------------------------------|-------------------|
21-
| `bind_interface` /`bind_address` /`routing_mark` /`reuse_addr` /`connect_timeout` | `detour` not set |
20+
| Field | Available Context |
21+
|---------------------------------------------------------------------------------------------------------------------|-------------------|
22+
| `bind_interface` /`bind_address` /`routing_mark` /`reuse_addr` / `tcp_fast_open`/ `udp_fragment` /`connect_timeout` | `detour` not set |
2223

2324
#### detour
2425

@@ -44,6 +45,14 @@ Set netfilter routing mark.
4445

4546
Reuse listener address.
4647

48+
#### tcp_fast_open
49+
50+
Enable TCP Fast Open.
51+
52+
#### udp_fragment
53+
54+
Enable UDP fragmentation.
55+
4756
#### connect_timeout
4857

4958
Connect timeout, in golang's Duration format.

docs/configuration/shared/dial.zh.md

+14
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,19 @@
99
"reuse_addr": false,
1010
"connect_timeout": "5s",
1111
"tcp_fast_open": false,
12+
"udp_fragment": false,
1213
"domain_strategy": "prefer_ipv6",
1314
"fallback_delay": "300ms"
1415
}
1516
```
1617

1718
### 字段
1819

20+
| 字段 | 可用上下文 |
21+
|---------------------------------------------------------------------------------------------------------------------|--------------|
22+
| `bind_interface` /`bind_address` /`routing_mark` /`reuse_addr` / `tcp_fast_open`/ `udp_fragment` /`connect_timeout` | `detour` 未设置 |
23+
24+
1925
#### detour
2026

2127
上游出站的标签。
@@ -42,6 +48,14 @@
4248

4349
重用监听地址。
4450

51+
#### tcp_fast_open
52+
53+
启用 TCP Fast Open。
54+
55+
#### udp_fragment
56+
57+
启用 UDP 分段。
58+
4559
#### connect_timeout
4660

4761
连接超时,采用 golang 的 Duration 格式。

docs/configuration/shared/listen.md

+19-8
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,27 @@
55
"listen": "::",
66
"listen_port": 5353,
77
"tcp_fast_open": false,
8+
"udp_fragment": false,
89
"sniff": false,
910
"sniff_override_destination": false,
1011
"domain_strategy": "prefer_ipv6",
1112
"udp_timeout": 300,
1213
"proxy_protocol": false,
14+
"proxy_protocol_accept_no_header": false,
1315
"detour": "another-in"
1416
}
1517
```
1618

1719
### Fields
1820

19-
| Field | Available Context |
20-
|------------------|-------------------------------------------------------------------|
21-
| `listen` | Needs to listen on TCP or UDP. |
22-
| `listen_port` | Needs to listen on TCP or UDP. |
23-
| `tcp_fast_open` | Needs to listen on TCP. |
24-
| `udp_timeout` | Needs to assemble UDP connections, currently Tun and Shadowsocks. |
25-
| `proxy_protocol` | Needs to listen on TCP. |
21+
| Field | Available Context |
22+
|-----------------------------------|-------------------------------------------------------------------|
23+
| `listen` | Needs to listen on TCP or UDP. |
24+
| `listen_port` | Needs to listen on TCP or UDP. |
25+
| `tcp_fast_open` | Needs to listen on TCP. |
26+
| `udp_timeout` | Needs to assemble UDP connections, currently Tun and Shadowsocks. |
27+
| `proxy_protocol` | Needs to listen on TCP. |
28+
| `proxy_protocol_accept_no_header` | When `proxy_protocol` enabled |
2629

2730
#### listen
2831

@@ -36,7 +39,11 @@ Listen port.
3639

3740
#### tcp_fast_open
3841

39-
Enable tcp fast open for listener.
42+
Enable TCP Fast Open.
43+
44+
#### udp_fragment
45+
46+
Enable UDP fragmentation.
4047

4148
#### sniff
4249

@@ -66,6 +73,10 @@ UDP NAT expiration time in seconds, default is 300 (5 minutes).
6673

6774
Parse [Proxy Protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) in the connection header.
6875

76+
#### proxy_protocol_accept_no_header
77+
78+
Accept connections without Proxy Protocol header.
79+
6980
#### detour
7081

7182
If set, connections will be forwarded to the specified inbound.

0 commit comments

Comments
 (0)