Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Sep 9, 2022
1 parent aa7e85c commit 8d04423
Show file tree
Hide file tree
Showing 12 changed files with 180 additions and 34 deletions.
2 changes: 1 addition & 1 deletion constant/version.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package constant

var (
Version = "1.0.1"
Version = "1.1-beta1"
Commit = ""
)
43 changes: 43 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,46 @@
#### 1.1-beta1

* Add support for use with android VPNService **1**
* Add tun support for WireGuard outbound **2**
* Add system tun stack **3**
* Add comment filter for config **4**
* Add option for allow optional proxy protocol header
* Add half close for smux
* Set UDP DF by default **5**
* Set default tun mtu to 9000
* Update gVisor to 20220905.0

*1*:

In previous versions, Android VPN would not work with tun enabled.

The usage of tun over VPN and VPN over tun is now supported, see [Tun Inbound](/configuration/inbound/tun#auto_route).

*2*:

In previous releases, WireGuard outbound support was backed by the lower performance gVisor virtual interface.

It achieves the same performance as wireguard-go by providing automatic system interface support.

*3*:

It does not depend on gVisor and has better performance in some cases.

It is less compatible and may not be available in some environments.

*4*:

Annotated json configuration files are now supported.

*5*:

UDP fragmentation is now blocked by default.

Including shadowsocks-libev, shadowsocks-rust and quic-go all disable segmentation by default.

See [Dial Fields](/configuration/shared/dial#udp_fragment)
and [Listen Fields](/configuration/shared/listen#udp_fragment).

#### 1.0.1

* Fix match 4in6 address in ip_cidr
Expand Down
19 changes: 14 additions & 5 deletions docs/configuration/inbound/tun.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"interface_name": "tun0",
"inet4_address": "172.19.0.1/30",
"inet6_address": "fdfe:dcba:9876::1/128",
"mtu": 1500,
"mtu": 9000,
"auto_route": true,
"strict_route": true,
"endpoint_independent_nat": false,
Expand Down Expand Up @@ -80,6 +80,10 @@ Set the default route to the Tun.

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

!!! note "Use with Android VPN"

By default, VPN takes precedence over tun. To make tun go through VPN, enable `route.override_android_vpn`.

#### strict_route

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

#### endpoint_independent_nat

!!! info ""

This item is only available on the gvisor stack, other stacks are endpoint-independent NAT by default.

Enable endpoint-independent NAT.

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

TCP/IP stack.

| Stack | Upstream | Status |
|------------------|-----------------------------------------------------------------------|-------------------|
| gVisor (default) | [google/gvisor](https://github.com/google/gvisor) | recommended |
| LWIP | [eycorsican/go-tun2socks](https://github.com/eycorsican/go-tun2socks) | upstream archived |
| Stack | Description | Status |
|------------------|--------------------------------------------------------------------------------|-------------------|
| gVisor (default) | Based on [google/gvisor](https://github.com/google/gvisor) | recommended |
| system | Less compatibility and sometimes better performance. | recommended |
| LWIP | Based on [eycorsican/go-tun2socks](https://github.com/eycorsican/go-tun2socks) | upstream archived |

!!! warning ""

Expand Down
15 changes: 10 additions & 5 deletions docs/configuration/inbound/tun.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"interface_name": "tun0",
"inet4_address": "172.19.0.1/30",
"inet6_address": "fdfe:dcba:9876::1/128",
"mtu": 1500,
"mtu": 9000,
"auto_route": true,
"strict_route": true,
"endpoint_independent_nat": false,
Expand Down Expand Up @@ -80,6 +80,10 @@ tun 接口的 IPv6 前缀。

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

!!! note "与 Android VPN 一起使用"

VPN 默认优先于 tun。要使 tun 经过 VPN,启用 `route.override_android_vpn`。

#### strict_route

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

TCP/IP 栈。

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

!!! warning ""

Expand Down
12 changes: 12 additions & 0 deletions docs/configuration/outbound/wireguard.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

"server": "127.0.0.1",
"server_port": 1080,
"system_interface": false,
"interface_name": "wg0",
"local_address": [
"10.0.0.2/32"
],
Expand Down Expand Up @@ -38,6 +40,16 @@ The server address.

The server port.

#### system_interface

Use system tun support.

Requires privileges and cannot conflict with system interfaces.

#### interface_name

Custom device name when `system_interface` enabled.

#### local_address

==Required==
Expand Down
12 changes: 12 additions & 0 deletions docs/configuration/outbound/wireguard.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

"server": "127.0.0.1",
"server_port": 1080,
"system_interface": false,
"interface_name": "wg0",
"local_address": [
"10.0.0.2/32"
],
Expand Down Expand Up @@ -38,6 +40,16 @@

服务器端口。

#### system_interface

使用系统 tun 支持。

需要特权且不能与系统接口冲突。

#### interface_name

启用 `system_interface` 时的自定义设备名称。

#### local_address

==必填==
Expand Down
13 changes: 11 additions & 2 deletions docs/configuration/route/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"rules": [],
"final": "",
"auto_detect_interface": false,
"override_android_vpn": false,
"default_interface": "en0",
"default_mark": 233
}
Expand All @@ -34,17 +35,25 @@ Default outbound tag. the first outbound will be used if empty.

Only supported on Linux, Windows and macOS.

Bind outbound connections to the default NIC by default to prevent routing loops under Tun.
Bind outbound connections to the default NIC by default to prevent routing loops under tun.

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

#### override_android_vpn

!!! error ""

Only supported on Android.

Accept Android VPN as upstream NIC when `auto_detect_interface` enabled.

#### default_interface

!!! error ""

Only supported on Linux, Windows and macOS.

Bind outbound connections to the specified NIC by default to prevent routing loops under Tun.
Bind outbound connections to the specified NIC by default to prevent routing loops under tun.

Takes no effect if `auto_detect_interface` is set.

Expand Down
13 changes: 11 additions & 2 deletions docs/configuration/route/index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"rules": [],
"final": "",
"auto_detect_interface": false,
"override_android_vpn": false,
"default_interface": "en0",
"default_mark": 233
}
Expand All @@ -34,17 +35,25 @@

仅支持 Linux、Windows 和 macOS。

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

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

#### override_android_vpn

!!! error ""

仅支持 Android。

启用 `auto_detect_interface` 时接受 Android VPN 作为上游网卡。

#### default_interface

!!! error ""

仅支持 Linux、Windows 和 macOS。

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

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

Expand Down
15 changes: 12 additions & 3 deletions docs/configuration/shared/dial.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@
"reuse_addr": false,
"connect_timeout": "5s",
"tcp_fast_open": false,
"udp_fragment": false,
"domain_strategy": "prefer_ipv6",
"fallback_delay": "300ms"
}
```

### Fields

| Field | Available Context |
|-----------------------------------------------------------------------------------|-------------------|
| `bind_interface` /`bind_address` /`routing_mark` /`reuse_addr` /`connect_timeout` | `detour` not set |
| Field | Available Context |
|---------------------------------------------------------------------------------------------------------------------|-------------------|
| `bind_interface` /`bind_address` /`routing_mark` /`reuse_addr` / `tcp_fast_open`/ `udp_fragment` /`connect_timeout` | `detour` not set |

#### detour

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

Reuse listener address.

#### tcp_fast_open

Enable TCP Fast Open.

#### udp_fragment

Enable UDP fragmentation.

#### connect_timeout

Connect timeout, in golang's Duration format.
Expand Down
14 changes: 14 additions & 0 deletions docs/configuration/shared/dial.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@
"reuse_addr": false,
"connect_timeout": "5s",
"tcp_fast_open": false,
"udp_fragment": false,
"domain_strategy": "prefer_ipv6",
"fallback_delay": "300ms"
}
```

### 字段

| 字段 | 可用上下文 |
|---------------------------------------------------------------------------------------------------------------------|--------------|
| `bind_interface` /`bind_address` /`routing_mark` /`reuse_addr` / `tcp_fast_open`/ `udp_fragment` /`connect_timeout` | `detour` 未设置 |


#### detour

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

重用监听地址。

#### tcp_fast_open

启用 TCP Fast Open。

#### udp_fragment

启用 UDP 分段。

#### connect_timeout

连接超时,采用 golang 的 Duration 格式。
Expand Down
27 changes: 19 additions & 8 deletions docs/configuration/shared/listen.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,27 @@
"listen": "::",
"listen_port": 5353,
"tcp_fast_open": false,
"udp_fragment": false,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"udp_timeout": 300,
"proxy_protocol": false,
"proxy_protocol_accept_no_header": false,
"detour": "another-in"
}
```

### Fields

| Field | Available Context |
|------------------|-------------------------------------------------------------------|
| `listen` | Needs to listen on TCP or UDP. |
| `listen_port` | Needs to listen on TCP or UDP. |
| `tcp_fast_open` | Needs to listen on TCP. |
| `udp_timeout` | Needs to assemble UDP connections, currently Tun and Shadowsocks. |
| `proxy_protocol` | Needs to listen on TCP. |
| Field | Available Context |
|-----------------------------------|-------------------------------------------------------------------|
| `listen` | Needs to listen on TCP or UDP. |
| `listen_port` | Needs to listen on TCP or UDP. |
| `tcp_fast_open` | Needs to listen on TCP. |
| `udp_timeout` | Needs to assemble UDP connections, currently Tun and Shadowsocks. |
| `proxy_protocol` | Needs to listen on TCP. |
| `proxy_protocol_accept_no_header` | When `proxy_protocol` enabled |

#### listen

Expand All @@ -36,7 +39,11 @@ Listen port.

#### tcp_fast_open

Enable tcp fast open for listener.
Enable TCP Fast Open.

#### udp_fragment

Enable UDP fragmentation.

#### sniff

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

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

#### proxy_protocol_accept_no_header

Accept connections without Proxy Protocol header.

#### detour

If set, connections will be forwarded to the specified inbound.
Expand Down
Loading

0 comments on commit 8d04423

Please sign in to comment.