Refactor inbound documetation

This commit is contained in:
世界 2022-08-31 12:50:26 +08:00
parent d8028a8632
commit 67c7e9fd86
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
32 changed files with 754 additions and 1522 deletions

View file

@ -4,29 +4,22 @@
```json ```json
{ {
"inbounds": [
{
"type": "direct", "type": "direct",
"tag": "direct-in", "tag": "direct-in",
"listen": "::", ... // Listen Fields
"listen_port": 5353,
"tcp_fast_open": false,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"udp_timeout": 300,
"proxy_protocol": false,
"network": "udp", "network": "udp",
"override_address": "1.0.0.1", "override_address": "1.0.0.1",
"override_port": 53 "override_port": 53
}
]
} }
``` ```
### Direct Fields ### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
### Fields
#### network #### network
@ -41,49 +34,3 @@ Override the connection destination address.
#### override_port #### override_port
Override the connection destination port. Override the connection destination port.
### Listen Fields
#### listen
==Required==
Listen address.
#### listen_port
==Required==
Listen port.
#### tcp_fast_open
Enable tcp fast open for listener.
#### sniff
Enable sniffing.
See [Protocol Sniff](/configuration/route/sniff/) for details.
#### sniff_override_destination
Override the connection destination address with the sniffed domain.
If the domain name is invalid (like tor), this will not work.
#### domain_strategy
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
If set, the requested domain name will be resolved to IP before routing.
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
#### udp_timeout
UDP NAT expiration time in seconds, default is 300 (5 minutes).
#### proxy_protocol
Parse [Proxy Protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) in the connection header.

View file

@ -4,29 +4,22 @@
```json ```json
{ {
"inbounds": [
{
"type": "direct", "type": "direct",
"tag": "direct-in", "tag": "direct-in",
"listen": "::", ... // 监听字段
"listen_port": 5353,
"tcp_fast_open": false,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"udp_timeout": 300,
"network": "udp", "network": "udp",
"proxy_protocol": false,
"override_address": "1.0.0.1", "override_address": "1.0.0.1",
"override_port": 53 "override_port": 53
}
]
} }
``` ```
### Direct 字段 ### 监听字段
参阅 [监听字段](/zh/configuration/shared/listen/)。
### 字段
#### network #### network
@ -42,48 +35,3 @@
覆盖连接目标端口。 覆盖连接目标端口。
### 监听字段
#### listen
==必填==
监听地址。
#### listen_port
==必填==
监听端口。
#### tcp_fast_open
为监听器启用 TCP 快速打开。
#### sniff
启用协议探测。
参阅 [协议探测](/zh/configuration/route/sniff/)
#### sniff_override_destination
用探测出的域名覆盖连接目标地址。
如果域名无效(如 Tor将不生效。
#### domain_strategy
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`
如果设置,请求的域名将在路由之前解析为 IP。
如果 `sniff_override_destination` 生效,它的值将作为后备。
#### udp_timeout
UDP NAT 过期时间,以秒为单位,默认为 3005 分钟)。
#### proxy_protocol
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。

View file

@ -2,18 +2,10 @@
```json ```json
{ {
"inbounds": [
{
"type": "http", "type": "http",
"tag": "http-in", "tag": "http-in",
"listen": "::", ... // Listen Fields
"listen_port": 2080,
"tcp_fast_open": false,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"proxy_protocol": false,
"users": [ "users": [
{ {
@ -23,12 +15,14 @@
], ],
"tls": {}, "tls": {},
"set_system_proxy": false "set_system_proxy": false
}
]
} }
``` ```
### HTTP Fields ### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
### Fields
#### tls #### tls
@ -47,45 +41,3 @@ No authentication required if empty.
Only supported on Linux, Android, Windows, and macOS. Only supported on Linux, Android, Windows, and macOS.
Automatically set system proxy configuration when start and clean up when stop. Automatically set system proxy configuration when start and clean up when stop.
### Listen Fields
#### listen
==Required==
Listen address.
#### listen_port
==Required==
Listen port.
#### tcp_fast_open
Enable tcp fast open for listener.
#### sniff
Enable sniffing.
See [Protocol Sniff](/configuration/route/sniff/) for details.
#### sniff_override_destination
Override the connection destination address with the sniffed domain.
If the domain name is invalid (like tor), this will not work.
#### domain_strategy
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
If set, the requested domain name will be resolved to IP before routing.
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
#### proxy_protocol
Parse [Proxy Protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) in the connection header.

View file

@ -2,18 +2,10 @@
```json ```json
{ {
"inbounds": [
{
"type": "http", "type": "http",
"tag": "http-in", "tag": "http-in",
"listen": "::", ... // 监听字段
"listen_port": 2080,
"tcp_fast_open": false,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"proxy_protocol": false,
"users": [ "users": [
{ {
@ -23,12 +15,14 @@
], ],
"tls": {}, "tls": {},
"set_system_proxy": false "set_system_proxy": false
}
]
} }
``` ```
### HTTP 字段 ### 监听字段
参阅 [监听字段](/zh/configuration/shared/listen/)。
### 字段
#### tls #### tls
@ -38,7 +32,7 @@ TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
HTTP 用户 HTTP 用户
默认不需要验证。 如果为空则不需要验证。
#### set_system_proxy #### set_system_proxy
@ -47,45 +41,3 @@ HTTP 用户
仅支持 Linux、Android、Windows 和 macOS。 仅支持 Linux、Android、Windows 和 macOS。
启动时自动设置系统代理,停止时自动清理。 启动时自动设置系统代理,停止时自动清理。
### 监听字段
#### listen
==必填==
监听地址。
#### listen_port
==必填==
监听端口。
#### tcp_fast_open
为监听器启用 TCP 快速打开。
#### sniff
启用协议探测。
参阅 [协议探测](/zh/configuration/route/sniff/)
#### sniff_override_destination
用探测出的域名覆盖连接目标地址。
如果域名无效(如 Tor将不生效。
#### domain_strategy
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`
如果设置,请求的域名将在路由之前解析为 IP。
如果 `sniff_override_destination` 生效,它的值将作为后备。
#### proxy_protocol
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。

View file

@ -2,16 +2,10 @@
```json ```json
{ {
"inbounds": [
{
"type": "hysteria", "type": "hysteria",
"tag": "hysteria-in", "tag": "hysteria-in",
"listen": "::", ... // Listen Fields
"listen_port": 443,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"up": "100 Mbps", "up": "100 Mbps",
"up_mbps": 100, "up_mbps": 100,
@ -25,8 +19,6 @@
"max_conn_client": 0, "max_conn_client": 0,
"disable_mtu_discovery": false, "disable_mtu_discovery": false,
"tls": {} "tls": {}
}
]
} }
``` ```
@ -34,7 +26,11 @@
QUIC, which is required by hysteria is not included by default, see [Installation](/#installation). QUIC, which is required by hysteria is not included by default, see [Installation](/#installation).
### Hysteria Fields ### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
### Fields
#### up, down #### up, down
@ -102,37 +98,3 @@ Force enabled on for systems other than Linux and Windows (according to upstream
==Required== ==Required==
TLS configuration, see [TLS](/configuration/shared/tls/#inbound). TLS configuration, see [TLS](/configuration/shared/tls/#inbound).
### Listen Fields
#### listen
==Required==
Listen address.
#### listen_port
==Required==
Listen port.
#### sniff
Enable sniffing.
See [Protocol Sniff](/configuration/route/sniff/) for details.
#### sniff_override_destination
Override the connection destination address with the sniffed domain.
If the domain name is invalid (like tor), this will not work.
#### domain_strategy
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
If set, the requested domain name will be resolved to IP before routing.
If `sniff_override_destination` is in effect, its value will be taken as a fallback.

View file

@ -2,16 +2,10 @@
```json ```json
{ {
"inbounds": [
{
"type": "hysteria", "type": "hysteria",
"tag": "hysteria-in", "tag": "hysteria-in",
"listen": "::", ... // 监听字段
"listen_port": 443,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"up": "100 Mbps", "up": "100 Mbps",
"up_mbps": 100, "up_mbps": 100,
@ -25,8 +19,6 @@
"max_conn_client": 0, "max_conn_client": 0,
"disable_mtu_discovery": false, "disable_mtu_discovery": false,
"tls": {} "tls": {}
}
]
} }
``` ```
@ -34,7 +26,11 @@
默认安装不包含被 Hysteria 依赖的 QUIC参阅 [安装](/zh/#_2)。 默认安装不包含被 Hysteria 依赖的 QUIC参阅 [安装](/zh/#_2)。
### Hysteria 字段 ### 监听字段
参阅 [监听字段](/zh/configuration/shared/listen/)。
### 字段
#### up, down #### up, down
@ -102,37 +98,3 @@ base64 编码的认证密码。
==必填== ==必填==
TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。 TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
### 监听字段
#### listen
==必填==
监听地址。
#### listen_port
==必填==
监听端口。
#### sniff
启用协议探测。
参阅 [协议探测](/zh/configuration/route/sniff/)。
#### sniff_override_destination
用探测出的域名覆盖连接目标地址。
如果域名无效(如 Tor将不生效。
#### domain_strategy
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`
如果设置,请求的域名将在路由之前解析为 IP。
如果 `sniff_override_destination` 生效,它的值将作为后备。

View file

@ -15,20 +15,20 @@
### Fields ### Fields
| Type | Format | | Type | Format | Injectable |
|---------------|------------------------------| |---------------|------------------------------|------------|
| `direct` | [Direct](./direct) | | `direct` | [Direct](./direct) | X |
| `mixed` | [Mixed](./mixed) | | `mixed` | [Mixed](./mixed) | TCP |
| `socks` | [SOCKS](./socks) | | `socks` | [SOCKS](./socks) | TCP |
| `http` | [HTTP](./http) | | `http` | [HTTP](./http) | TCP |
| `shadowsocks` | [Shadowsocks](./shadowsocks) | | `shadowsocks` | [Shadowsocks](./shadowsocks) | TCP |
| `vmess` | [VMess](./vmess) | | `vmess` | [VMess](./vmess) | TCP |
| `trojan` | [Trojan](./trojan) | | `trojan` | [Trojan](./trojan) | TCP |
| `naive` | [Naive](./naive) | | `naive` | [Naive](./naive) | X |
| `hysteria` | [Hysteria](./hysteria) | | `hysteria` | [Hysteria](./hysteria) | X |
| `tun` | [Tun](./tun) | | `tun` | [Tun](./tun) | X |
| `redirect` | [Redirect](./redirect) | | `redirect` | [Redirect](./redirect) | X |
| `tproxy` | [TProxy](./tproxy) | | `tproxy` | [TProxy](./tproxy) | X |
#### tag #### tag

View file

@ -15,20 +15,20 @@
### 字段 ### 字段
| 类型 | 格式 | | 类型 | 格式 | 注入支持 |
|---------------|------------------------------| |---------------|------------------------------|------|
| `direct` | [Direct](./direct) | | `direct` | [Direct](./direct) | X |
| `mixed` | [Mixed](./mixed) | | `mixed` | [Mixed](./mixed) | TCP |
| `socks` | [SOCKS](./socks) | | `socks` | [SOCKS](./socks) | TCP |
| `http` | [HTTP](./http) | | `http` | [HTTP](./http) | TCP |
| `shadowsocks` | [Shadowsocks](./shadowsocks) | | `shadowsocks` | [Shadowsocks](./shadowsocks) | TCP |
| `vmess` | [VMess](./vmess) | | `vmess` | [VMess](./vmess) | TCP |
| `trojan` | [Trojan](./trojan) | | `trojan` | [Trojan](./trojan) | TCP |
| `naive` | [Naive](./naive) | | `naive` | [Naive](./naive) | X |
| `hysteria` | [Hysteria](./hysteria) | | `hysteria` | [Hysteria](./hysteria) | X |
| `tun` | [Tun](./tun) | | `tun` | [Tun](./tun) | X |
| `redirect` | [Redirect](./redirect) | | `redirect` | [Redirect](./redirect) | X |
| `tproxy` | [TProxy](./tproxy) | | `tproxy` | [TProxy](./tproxy) | X |
#### tag #### tag

View file

@ -4,18 +4,10 @@
```json ```json
{ {
"inbounds": [
{
"type": "mixed", "type": "mixed",
"tag": "mixed-in", "tag": "mixed-in",
"listen": "::", ... // Listen Fields
"listen_port": 2080,
"tcp_fast_open": false,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"proxy_protocol": false,
"users": [ "users": [
{ {
@ -24,12 +16,14 @@
} }
], ],
"set_system_proxy": false "set_system_proxy": false
}
]
} }
``` ```
### Mixed Fields ### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
### Fields
#### users #### users
@ -44,49 +38,3 @@ No authentication required if empty.
Only supported on Linux, Android, Windows, and macOS. Only supported on Linux, Android, Windows, and macOS.
Automatically set system proxy configuration when start and clean up when stop. Automatically set system proxy configuration when start and clean up when stop.
### Listen Fields
#### listen
==Required==
Listen address.
#### listen_port
==Required==
Listen port.
#### tcp_fast_open
Enable tcp fast open for listener.
#### sniff
Enable sniffing.
See [Protocol Sniff](/configuration/route/sniff/) for details.
#### sniff_override_destination
Override the connection destination address with the sniffed domain.
If the domain name is invalid (like tor), this will not work.
#### domain_strategy
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
If set, the requested domain name will be resolved to IP before routing.
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
#### set_system_proxy
!!! error ""
Only supported on Linux, Android, Windows, and macOS.
Automatically set system proxy configuration when start and clean up when stop.

View file

@ -4,18 +4,10 @@
```json ```json
{ {
"inbounds": [
{
"type": "mixed", "type": "mixed",
"tag": "mixed-in", "tag": "mixed-in",
"listen": "::", ... // 监听字段
"listen_port": 2080,
"tcp_fast_open": false,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"proxy_protocol": false,
"users": [ "users": [
{ {
@ -24,18 +16,20 @@
} }
], ],
"set_system_proxy": false "set_system_proxy": false
}
]
} }
``` ```
### Mixed 字段 ### 监听字段
参阅 [监听字段](/zh/configuration/shared/listen/)。
### 字段
#### users #### users
SOCKS 和 HTTP 用户 SOCKS 和 HTTP 用户
默认不需要验证。 如果为空则不需要验证。
#### set_system_proxy #### set_system_proxy
@ -44,45 +38,3 @@ SOCKS 和 HTTP 用户
仅支持 Linux、Android、Windows 和 macOS。 仅支持 Linux、Android、Windows 和 macOS。
启动时自动设置系统代理,停止时自动清理。 启动时自动设置系统代理,停止时自动清理。
### 监听字段
#### listen
==必填==
监听地址。
#### listen_port
==必填==
监听端口。
#### tcp_fast_open
为监听器启用 TCP 快速打开。
#### sniff
启用协议探测。
参阅 [协议探测](/zh/configuration/route/sniff/)。
#### sniff_override_destination
用探测出的域名覆盖连接目标地址。
如果域名无效(如 Tor将不生效。
#### domain_strategy
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`
如果设置,请求的域名将在路由之前解析为 IP。
如果 `sniff_override_destination` 生效,它的值将作为后备。
#### proxy_protocol
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。

View file

@ -2,20 +2,12 @@
```json ```json
{ {
"inbounds": [
{
"type": "naive", "type": "naive",
"tag": "naive-in", "tag": "naive-in",
"listen": "::",
"listen_port": 443,
"tcp_fast_open": false,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"proxy_protocol": false,
"network": "udp", "network": "udp",
... // Listen Fields
"users": [ "users": [
{ {
"username": "sekai", "username": "sekai",
@ -23,8 +15,6 @@
} }
], ],
"tls": {} "tls": {}
}
]
} }
``` ```
@ -32,7 +22,11 @@
HTTP3 transport is not included by default, see [Installation](/#installation). HTTP3 transport is not included by default, see [Installation](/#installation).
### Naive Fields ### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
### Fields
#### network #### network
@ -49,45 +43,3 @@ Naive users.
#### tls #### tls
TLS configuration, see [TLS](/configuration/shared/tls/#inbound). TLS configuration, see [TLS](/configuration/shared/tls/#inbound).
### Listen Fields
#### listen
==Required==
Listen address.
#### listen_port
==Required==
Listen port.
#### tcp_fast_open
Enable tcp fast open for listener.
#### sniff
Enable sniffing.
See [Protocol Sniff](/configuration/route/sniff/) for details.
#### sniff_override_destination
Override the connection destination address with the sniffed domain.
If the domain name is invalid (like tor), this will not work.
#### domain_strategy
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
If set, the requested domain name will be resolved to IP before routing.
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
#### proxy_protocol
Parse [Proxy Protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) in the connection header.

View file

@ -2,20 +2,12 @@
```json ```json
{ {
"inbounds": [
{
"type": "naive", "type": "naive",
"tag": "naive-in", "tag": "naive-in",
"listen": "::",
"listen_port": 443,
"tcp_fast_open": false,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"proxy_protocol": false,
"network": "udp", "network": "udp",
... // 监听字段
"users": [ "users": [
{ {
"username": "sekai", "username": "sekai",
@ -23,8 +15,6 @@
} }
], ],
"tls": {} "tls": {}
}
]
} }
``` ```
@ -32,7 +22,11 @@
默认安装不包含 HTTP3 传输层, 参阅 [安装](/zh/#_2)。 默认安装不包含 HTTP3 传输层, 参阅 [安装](/zh/#_2)。
### Naive 字段 ### 监听字段
参阅 [监听字段](/zh/configuration/shared/listen/)。
### 字段
#### network #### network
@ -49,45 +43,3 @@ Naive 用户。
#### tls #### tls
TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。 TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
### 监听字段
#### listen
==必填==
监听地址。
#### listen_port
==必填==
监听端口。
#### tcp_fast_open
为监听器启用 TCP 快速打开。
#### sniff
启用协议探测。
参阅 [协议探测](/zh/configuration/route/sniff/)。
#### sniff_override_destination
用探测出的域名覆盖连接目标地址。
如果域名无效(如 Tor将不生效。
#### domain_strategy
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`
如果设置,请求的域名将在路由之前解析为 IP。
如果 `sniff_override_destination` 生效,它的值将作为后备。
#### proxy_protocol
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。

View file

@ -2,51 +2,13 @@
```json ```json
{ {
"inbounds": [
{
"type": "redirect", "type": "redirect",
"tag": "redirect-in", "tag": "redirect-in",
"listen": "::", ... // Listen Fields
"listen_port": 5353,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6"
}
]
} }
``` ```
### Listen Fields ### Listen Fields
#### listen See [Listen Fields](/configuration/shared/listen) for details.
==Required==
Listen address.
#### listen_port
==Required==
Listen port.
#### sniff
Enable sniffing.
See [Protocol Sniff](/configuration/route/sniff/) for details.
#### sniff_override_destination
Override the connection destination address with the sniffed domain.
If the domain name is invalid (like tor), this will not work.
#### domain_strategy
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
If set, the requested domain name will be resolved to IP before routing.
If `sniff_override_destination` is in effect, its value will be taken as a fallback.

View file

@ -2,51 +2,12 @@
```json ```json
{ {
"inbounds": [
{
"type": "redirect", "type": "redirect",
"tag": "redirect-in", "tag": "redirect-in",
"listen": "::", ... // 监听字段
"listen_port": 5353,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6"
}
]
} }
``` ```
### 监听字段 ### 监听字段
#### listen 参阅 [监听字段](/zh/configuration/shared/listen/)。
==必填==
监听地址。
#### listen_port
==必填==
监听端口。
#### sniff
启用协议探测。
参阅 [协议探测](/zh/configuration/route/sniff/)。
#### sniff_override_destination
用探测出的域名覆盖连接目标地址。
如果域名无效(如 Tor将不生效。
#### domain_strategy
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`
如果设置,请求的域名将在路由之前解析为 IP。
如果 `sniff_override_destination` 生效,它的值将作为后备。

View file

@ -2,25 +2,13 @@
```json ```json
{ {
"inbounds": [
{
"type": "shadowsocks", "type": "shadowsocks",
"tag": "ss-in", "tag": "ss-in",
"listen": "::", ... // Listen Fields
"listen_port": 5353,
"tcp_fast_open": false,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"udp_timeout": 300,
"network": "udp",
"proxy_protocol": false,
"method": "2022-blake3-aes-128-gcm", "method": "2022-blake3-aes-128-gcm",
"password": "8JCsPssfgS8tiRwiMlhARg==" "password": "8JCsPssfgS8tiRwiMlhARg=="
}
]
} }
``` ```
@ -28,9 +16,6 @@
```json ```json
{ {
"inbounds": [
{
"type": "shadowsocks",
"method": "2022-blake3-aes-128-gcm", "method": "2022-blake3-aes-128-gcm",
"password": "8JCsPssfgS8tiRwiMlhARg==", "password": "8JCsPssfgS8tiRwiMlhARg==",
"users": [ "users": [
@ -39,8 +24,6 @@
"password": "PCD2Z4o12bKUoFa3cC97Hw==" "password": "PCD2Z4o12bKUoFa3cC97Hw=="
} }
] ]
}
]
} }
``` ```
@ -48,8 +31,6 @@
```json ```json
{ {
"inbounds": [
{
"type": "shadowsocks", "type": "shadowsocks",
"method": "2022-blake3-aes-128-gcm", "method": "2022-blake3-aes-128-gcm",
"password": "8JCsPssfgS8tiRwiMlhARg==", "password": "8JCsPssfgS8tiRwiMlhARg==",
@ -61,12 +42,14 @@
"password": "PCD2Z4o12bKUoFa3cC97Hw==" "password": "PCD2Z4o12bKUoFa3cC97Hw=="
} }
] ]
}
]
} }
``` ```
### Shadowsocks Fields ### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
### Fields
#### network #### network

View file

@ -2,25 +2,13 @@
```json ```json
{ {
"inbounds": [
{
"type": "shadowsocks", "type": "shadowsocks",
"tag": "ss-in", "tag": "ss-in",
"listen": "::", ... // 监听字段
"listen_port": 5353,
"tcp_fast_open": false,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"udp_timeout": 300,
"network": "udp",
"proxy_protocol": false,
"method": "2022-blake3-aes-128-gcm", "method": "2022-blake3-aes-128-gcm",
"password": "8JCsPssfgS8tiRwiMlhARg==" "password": "8JCsPssfgS8tiRwiMlhARg=="
}
]
} }
``` ```
@ -28,9 +16,6 @@
```json ```json
{ {
"inbounds": [
{
"type": "shadowsocks",
"method": "2022-blake3-aes-128-gcm", "method": "2022-blake3-aes-128-gcm",
"password": "8JCsPssfgS8tiRwiMlhARg==", "password": "8JCsPssfgS8tiRwiMlhARg==",
"users": [ "users": [
@ -39,8 +24,6 @@
"password": "PCD2Z4o12bKUoFa3cC97Hw==" "password": "PCD2Z4o12bKUoFa3cC97Hw=="
} }
] ]
}
]
} }
``` ```
@ -48,8 +31,6 @@
```json ```json
{ {
"inbounds": [
{
"type": "shadowsocks", "type": "shadowsocks",
"method": "2022-blake3-aes-128-gcm", "method": "2022-blake3-aes-128-gcm",
"password": "8JCsPssfgS8tiRwiMlhARg==", "password": "8JCsPssfgS8tiRwiMlhARg==",
@ -61,12 +42,14 @@
"password": "PCD2Z4o12bKUoFa3cC97Hw==" "password": "PCD2Z4o12bKUoFa3cC97Hw=="
} }
] ]
}
]
} }
``` ```
### Shadowsocks 字段 ### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
### 字段
#### network #### network
@ -99,49 +82,3 @@
| none | / | | none | / |
| 2022 methods | `openssl rand -base64 <密钥长度>` | | 2022 methods | `openssl rand -base64 <密钥长度>` |
| other methods | 任意字符串 | | other methods | 任意字符串 |
### 监听字段
#### listen
==必填==
监听地址。
#### listen_port
==必填==
监听端口。
#### tcp_fast_open
为监听器启用 TCP 快速打开。
#### sniff
启用协议探测。
参阅 [协议探测](/zh/configuration/route/sniff/)。
#### sniff_override_destination
用探测出的域名覆盖连接目标地址。
如果域名无效(如 Tor将不生效。
#### domain_strategy
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`
如果设置,请求的域名将在路由之前解析为 IP。
如果 `sniff_override_destination` 生效,它的值将作为后备。
#### udp_timeout
UDP NAT 过期时间,以秒为单位,默认为 3005 分钟)。
#### proxy_protocol
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。

View file

@ -4,18 +4,10 @@
```json ```json
{ {
"inbounds": [
{
"type": "socks", "type": "socks",
"tag": "socks-in", "tag": "socks-in",
"listen": "::", ... // Listen Fields
"listen_port": 2080,
"tcp_fast_open": false,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"proxy_protocol": false,
"users": [ "users": [
{ {
@ -23,57 +15,17 @@
"password": "admin" "password": "admin"
} }
] ]
}
]
} }
``` ```
### SOCKS Fields ### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
### Fields
#### users #### users
SOCKS users. SOCKS users.
No authentication required if empty. No authentication required if empty.
### Listen Fields
#### listen
==Required==
Listen address.
#### listen_port
==Required==
Listen port.
#### tcp_fast_open
Enable tcp fast open for listener.
#### sniff
Enable sniffing.
See [Protocol Sniff](/configuration/route/sniff/) for details.
#### sniff_override_destination
Override the connection destination address with the sniffed domain.
If the domain name is invalid (like tor), this will not work.
#### domain_strategy
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
If set, the requested domain name will be resolved to IP before routing.
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
#### proxy_protocol
Parse [Proxy Protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) in the connection header.

View file

@ -4,18 +4,10 @@
```json ```json
{ {
"inbounds": [
{
"type": "socks", "type": "socks",
"tag": "socks-in", "tag": "socks-in",
"listen": "::", ... // 监听字段
"listen_port": 2080,
"tcp_fast_open": false,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"proxy_protocol": false,
"users": [ "users": [
{ {
@ -23,57 +15,17 @@
"password": "admin" "password": "admin"
} }
] ]
}
]
} }
``` ```
### SOCKS 字段 ### 监听字段
参阅 [监听字段](/zh/configuration/shared/listen/)。
### 字段
#### users #### users
SOCKS 用户 SOCKS 用户
默认不需要验证。 如果为空则不需要验证。
### Listen Fields
#### listen
==必填==
监听地址。
#### listen_port
==必填==
监听端口。
#### tcp_fast_open
为监听器启用 TCP 快速打开。
#### sniff
启用协议探测。
参阅 [协议探测](/zh/configuration/route/sniff/)。
#### sniff_override_destination
用探测出的域名覆盖连接目标地址。
如果域名无效(如 Tor将不生效。
#### domain_strategy
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`
如果设置,请求的域名将在路由之前解析为 IP。
如果 `sniff_override_destination` 生效,它的值将作为后备。
#### proxy_protocol
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。

View file

@ -2,66 +2,23 @@
```json ```json
{ {
"inbounds": [
{
"type": "tproxy", "type": "tproxy",
"tag": "tproxy-in", "tag": "tproxy-in",
"listen": "::", ... // Listen Fields
"listen_port": 5353,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"udp_timeout": 300,
"network": "udp" "network": "udp"
}
]
} }
``` ```
### TProxy Fields ### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
### Fields
#### network #### network
Listen network, one of `tcp` `udp`. Listen network, one of `tcp` `udp`.
Both if empty. Both if empty.
### Listen Fields
#### listen
==Required==
Listen address.
#### listen_port
==Required==
Listen port.
#### sniff
Enable sniffing.
See [Protocol Sniff](/configuration/route/sniff/) for details.
#### sniff_override_destination
Override the connection destination address with the sniffed domain.
If the domain name is invalid (like tor), this will not work.
#### domain_strategy
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
If set, the requested domain name will be resolved to IP before routing.
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
#### udp_timeout
UDP NAT expiration time in seconds, default is 300 (5 minutes).

View file

@ -2,66 +2,23 @@
```json ```json
{ {
"inbounds": [
{
"type": "tproxy", "type": "tproxy",
"tag": "tproxy-in", "tag": "tproxy-in",
"listen": "::", ... // 监听字段
"listen_port": 5353,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"udp_timeout": 300,
"network": "udp" "network": "udp"
}
]
} }
``` ```
### TProxy 字段 ### 监听字段
参阅 [监听字段](/zh/configuration/shared/listen/)。
### 字段
#### network #### network
监听的网络协议,`tcp` `udp` 之一。 监听的网络协议,`tcp` `udp` 之一。
默认所有。 默认所有。
### 监听字段
#### listen
==必填==
监听地址。
#### listen_port
==必填==
监听端口。
#### sniff
启用协议探测。
参阅 [协议探测](/zh/configuration/route/sniff/)。
#### sniff_override_destination
用探测出的域名覆盖连接目标地址。
如果域名无效(如 Tor将不生效。
#### domain_strategy
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`
如果设置,请求的域名将在路由之前解析为 IP。
如果 `sniff_override_destination` 生效,它的值将作为后备。
#### udp_timeout
UDP NAT 过期时间,以秒为单位,默认为 3005 分钟)。

View file

@ -2,18 +2,10 @@
```json ```json
{ {
"inbounds": [
{
"type": "trojan", "type": "trojan",
"tag": "trojan-in", "tag": "trojan-in",
"listen": "::", ... // Listen Fields
"listen_port": 2080,
"tcp_fast_open": false,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"proxy_protocol": false,
"users": [ "users": [
{ {
@ -33,12 +25,14 @@
} }
}, },
"transport": {} "transport": {}
}
]
} }
``` ```
### Trojan Fields ### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
### Fields
#### users #### users
@ -67,45 +61,3 @@ If not empty, TLS fallback requests with ALPN not in this table will be rejected
#### transport #### transport
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport). V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport).
### Listen Fields
#### listen
==Required==
Listen address.
#### listen_port
==Required==
Listen port.
#### tcp_fast_open
Enable tcp fast open for listener.
#### sniff
Enable sniffing.
See [Protocol Sniff](/configuration/route/sniff/) for details.
#### sniff_override_destination
Override the connection destination address with the sniffed domain.
If the domain name is invalid (like tor), this will not work.
#### domain_strategy
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
If set, the requested domain name will be resolved to IP before routing.
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
#### proxy_protocol
Parse [Proxy Protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) in the connection header.

View file

@ -2,17 +2,11 @@
```json ```json
{ {
"inbounds": [
{
"type": "trojan", "type": "trojan",
"tag": "trojan-in", "tag": "trojan-in",
"listen": "::",
"listen_port": 2080, ... // 监听字段
"tcp_fast_open": false,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"proxy_protocol": false,
"users": [ "users": [
{ {
"name": "sekai", "name": "sekai",
@ -31,12 +25,14 @@
} }
}, },
"transport": {} "transport": {}
}
]
} }
``` ```
### Trojan 字段 ### 监听字段
参阅 [监听字段](/zh/configuration/shared/listen/)。
### 字段
#### users #### users
@ -67,45 +63,3 @@ TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
#### transport #### transport
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。 V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。
### 监听字段
#### listen
==必填==
监听地址。
#### listen_port
==必填==
监听端口。
#### tcp_fast_open
为监听器启用 TCP 快速打开。
#### sniff
启用协议探测。
参阅 [协议探测](/zh/configuration/route/sniff/)。
#### sniff_override_destination
用探测出的域名覆盖连接目标地址。
如果域名无效(如 Tor将不生效。
#### domain_strategy
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`
如果设置,请求的域名将在路由之前解析为 IP。
如果 `sniff_override_destination` 生效,它的值将作为后备。
#### proxy_protocol
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。

View file

@ -6,10 +6,9 @@
```json ```json
{ {
"inbounds": [
{
"type": "tun", "type": "tun",
"tag": "tun-in", "tag": "tun-in",
"interface_name": "tun0", "interface_name": "tun0",
"inet4_address": "172.19.0.1/30", "inet4_address": "172.19.0.1/30",
"inet6_address": "fdfe:dcba:9876::1/128", "inet6_address": "fdfe:dcba:9876::1/128",
@ -17,15 +16,12 @@
"auto_route": true, "auto_route": true,
"strict_route": true, "strict_route": true,
"endpoint_independent_nat": false, "endpoint_independent_nat": false,
"udp_timeout": 300,
"stack": "gvisor", "stack": "gvisor",
"include_uid": [ "include_uid": [
0 0
], ],
"include_uid_range": [ "include_uid_range": [
[
"1000-99999" "1000-99999"
]
], ],
"exclude_uid": [ "exclude_uid": [
1000 1000
@ -43,11 +39,8 @@
"exclude_package": [ "exclude_package": [
"com.android.captiveportallogin" "com.android.captiveportallogin"
], ],
"sniff": true,
"sniff_override_destination": false, ... // Listen Fields
"domain_strategy": "prefer_ipv4"
}
]
} }
``` ```
@ -59,7 +52,7 @@
If tun is running in non-privileged mode, addresses and MTU will not be configured automatically, please make sure the settings are accurate. If tun is running in non-privileged mode, addresses and MTU will not be configured automatically, please make sure the settings are accurate.
### Tun Fields ### Fields
#### interface_name #### interface_name
@ -163,22 +156,4 @@ Exclude android packages in route.
### Listen Fields ### Listen Fields
#### sniff See [Listen Fields](/configuration/shared/listen) for details.
Enable sniffing.
See [Protocol Sniff](/configuration/route/sniff/) for details.
#### sniff_override_destination
Override the connection destination address with the sniffed domain.
If the domain name is invalid (like tor), this will not work.
#### domain_strategy
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
If set, the requested domain name will be resolved to IP before routing.
If `sniff_override_destination` is in effect, its value will be taken as a fallback.

View file

@ -6,10 +6,9 @@
```json ```json
{ {
"inbounds": [
{
"type": "tun", "type": "tun",
"tag": "tun-in", "tag": "tun-in",
"interface_name": "tun0", "interface_name": "tun0",
"inet4_address": "172.19.0.1/30", "inet4_address": "172.19.0.1/30",
"inet6_address": "fdfe:dcba:9876::1/128", "inet6_address": "fdfe:dcba:9876::1/128",
@ -17,15 +16,12 @@
"auto_route": true, "auto_route": true,
"strict_route": true, "strict_route": true,
"endpoint_independent_nat": false, "endpoint_independent_nat": false,
"udp_timeout": 300,
"stack": "gvisor", "stack": "gvisor",
"include_uid": [ "include_uid": [
0 0
], ],
"include_uid_range": [ "include_uid_range": [
[
"1000-99999" "1000-99999"
]
], ],
"exclude_uid": [ "exclude_uid": [
1000 1000
@ -43,11 +39,8 @@
"exclude_package": [ "exclude_package": [
"com.android.captiveportallogin" "com.android.captiveportallogin"
], ],
"sniff": true,
"sniff_override_destination": false, ... // 监听字段
"domain_strategy": "prefer_ipv4"
}
]
} }
``` ```
@ -162,22 +155,4 @@ TCP/IP 栈。
### 监听字段 ### 监听字段
#### sniff 参阅 [监听字段](/zh/configuration/shared/listen/)。
启用协议探测。
参阅 [协议探测](/zh/configuration/route/sniff/)。
#### sniff_override_destination
用探测出的域名覆盖连接目标地址。
如果域名无效(如 Tor将不生效。
#### domain_strategy
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`
如果设置,请求的域名将在路由之前解析为 IP。
如果 `sniff_override_destination` 生效,它的值将作为后备。

View file

@ -2,18 +2,10 @@
```json ```json
{ {
"inbounds": [
{
"type": "vmess", "type": "vmess",
"tag": "vmess-in", "tag": "vmess-in",
"listen": "::", ... // Listen Fields
"listen_port": 2080,
"tcp_fast_open": false,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"proxy_protocol": false,
"users": [ "users": [
{ {
@ -24,12 +16,14 @@
], ],
"tls": {}, "tls": {},
"transport": {} "transport": {}
}
]
} }
``` ```
### VMess Fields ### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
### Fields
#### users #### users
@ -53,45 +47,3 @@ TLS configuration, see [TLS](/configuration/shared/tls/#inbound).
#### transport #### transport
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport). V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport).
### Listen Fields
#### listen
==Required==
Listen address.
#### listen_port
==Required==
Listen port.
#### tcp_fast_open
Enable tcp fast open for listener.
#### sniff
Enable sniffing.
See [Protocol Sniff](/configuration/route/sniff/) for details.
#### sniff_override_destination
Override the connection destination address with the sniffed domain.
If the domain name is invalid (like tor), this will not work.
#### domain_strategy
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
If set, the requested domain name will be resolved to IP before routing.
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
#### proxy_protocol
Parse [Proxy Protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) in the connection header.

View file

@ -2,18 +2,10 @@
```json ```json
{ {
"inbounds": [
{
"type": "vmess", "type": "vmess",
"tag": "vmess-in", "tag": "vmess-in",
"listen": "::", ... // 监听字段
"listen_port": 2080,
"tcp_fast_open": false,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"proxy_protocol": false,
"users": [ "users": [
{ {
@ -24,12 +16,14 @@
], ],
"tls": {}, "tls": {},
"transport": {} "transport": {}
}
]
} }
``` ```
### VMess 字段 ### 监听字段
参阅 [监听字段](/zh/configuration/shared/listen/)。
### 字段
#### users #### users
@ -53,45 +47,3 @@ TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
#### transport #### transport
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。 V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。
### 监听字段
#### listen
==必填==
监听地址。
#### listen_port
==必填==
监听端口。
#### tcp_fast_open
为监听器启用 TCP 快速打开。
#### sniff
启用协议探测。
参阅 [协议探测](/zh/configuration/route/sniff/)。
#### sniff_override_destination
用探测出的域名覆盖连接目标地址。
如果域名无效(如 Tor将不生效。
#### domain_strategy
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`
如果设置,请求的域名将在路由之前解析为 IP。
如果 `sniff_override_destination` 生效,它的值将作为后备。
#### proxy_protocol
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。

View file

@ -0,0 +1,69 @@
### Structure
```json
{
"detour": "upstream-out",
"bind_interface": "en0",
"bind_address": "0.0.0.0",
"routing_mark": 1234,
"reuse_addr": false,
"connect_timeout": "5s",
"tcp_fast_open": false,
"domain_strategy": "prefer_ipv6",
"fallback_delay": "300ms"
}
```
### Fields
#### detour
The tag of the upstream outbound.
Other dial fields will be ignored when enabled.
#### bind_interface
The network interface to bind to.
#### bind_address
The address to bind to.
#### routing_mark
!!! error ""
Only supported on Linux.
Set netfilter routing mark.
#### reuse_addr
Reuse listener address.
#### connect_timeout
Connect timeout, in golang's Duration format.
A duration string is a possibly signed sequence of
decimal numbers, each with optional fraction and a unit suffix,
such as "300ms", "-1.5h" or "2h45m".
Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
#### domain_strategy
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
If set, the requested domain name will be resolved to IP before connect.
`dns.strategy` will be used if empty.
#### fallback_delay
The length of time to wait before spawning a RFC 6555 Fast Fallback connection.
That is, is the amount of time to wait for IPv6 to succeed before assuming
that IPv6 is misconfigured and falling back to IPv4 if `prefer_ipv4` is set.
If zero, a default delay of 300ms is used.
Only take effect when `domain_strategy` is `prefer_ipv4` or `prefer_ipv6`.

View file

@ -0,0 +1,66 @@
### 结构
```json
{
"detour": "upstream-out",
"bind_interface": "en0",
"bind_address": "0.0.0.0",
"routing_mark": 1234,
"reuse_addr": false,
"connect_timeout": "5s",
"tcp_fast_open": false,
"domain_strategy": "prefer_ipv6",
"fallback_delay": "300ms"
}
```
### 字段
#### detour
上游出站的标签。
启用时,其他拨号字段将被忽略。
#### bind_interface
要绑定到的网络接口。
#### bind_address
要绑定的地址。
#### routing_mark
!!! error ""
仅支持 Linux。
设置 netfilter 路由标记。
#### reuse_addr
重用监听地址。
#### connect_timeout
连接超时,采用 golang 的 Duration 格式。
持续时间字符串是一个可能有符号的序列十进制数,每个都有可选的分数和单位后缀, 例如 "300ms"、"-1.5h" 或 "2h45m"。
有效时间单位为 "ns"、"us"(或 "µs")、"ms"、"s"、"m"、"h"。
#### domain_strategy
可选值:`prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`
如果设置,域名将在请求发出之前解析为 IP。
默认使用 `dns.strategy`
#### fallback_delay
在生成 RFC 6555 快速回退连接之前等待的时间长度。
也就是说,是在假设之前等待 IPv6 成功的时间量如果设置了 "prefer_ipv4",则 IPv6 配置错误并回退到 IPv4。
如果为零,则使用 300 毫秒的默认延迟。
仅当 `domain_strategy``prefer_ipv4``prefer_ipv6` 时生效。

View file

@ -0,0 +1,73 @@
### Structure
```json
{
"listen": "::",
"listen_port": 5353,
"tcp_fast_open": false,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"udp_timeout": 300,
"proxy_protocol": 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. |
#### listen
==Required==
Listen address.
#### listen_port
Listen port.
#### tcp_fast_open
Enable tcp fast open for listener.
#### sniff
Enable sniffing.
See [Protocol Sniff](/configuration/route/sniff/) for details.
#### sniff_override_destination
Override the connection destination address with the sniffed domain.
If the domain name is invalid (like tor), this will not work.
#### domain_strategy
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
If set, the requested domain name will be resolved to IP before routing.
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
#### udp_timeout
UDP NAT expiration time in seconds, default is 300 (5 minutes).
#### proxy_protocol
Parse [Proxy Protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) in the connection header.
#### detour
If set, connections will be forwarded to the specified inbound.
Requires target inbound support, see [Injectable](/configuration/inbound/#fields).

View file

@ -0,0 +1,72 @@
### 结构
```json
{
"listen": "::",
"listen_port": 5353,
"tcp_fast_open": false,
"sniff": false,
"sniff_override_destination": false,
"domain_strategy": "prefer_ipv6",
"udp_timeout": 300,
"detour": "another-in"
}
```
| 字段 | 可用上下文 |
|------------------|-------------------------------------|
| `listen` | 需要监听 TCP 或 UDP。 |
| `listen_port` | 需要监听 TCP 或 UDP。 |
| `tcp_fast_open` | 需要监听 TCP。 |
| `udp_timeout` | 需要组装 UDP 连接, 当前为 Tun 和 Shadowsocks。 |
| `proxy_protocol` | 需要监听 TCP。 |
### 字段
#### listen
==必填==
监听地址。
#### listen_port
监听端口。
#### tcp_fast_open
为监听器启用 TCP 快速打开。
#### sniff
启用协议探测。
参阅 [协议探测](/zh/configuration/route/sniff/)
#### sniff_override_destination
用探测出的域名覆盖连接目标地址。
如果域名无效(如 Tor将不生效。
#### domain_strategy
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`
如果设置,请求的域名将在路由之前解析为 IP。
如果 `sniff_override_destination` 生效,它的值将作为后备。
#### udp_timeout
UDP NAT 过期时间,以秒为单位,默认为 3005 分钟)。
#### proxy_protocol
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。
#### detour
如果设置,连接将被转发到指定的入站。
需要目标入站支持,参阅 [注入支持](/zh/configuration/inbound/#_3)。

View file

@ -52,6 +52,8 @@ nav:
- Experimental: - Experimental:
- configuration/experimental/index.md - configuration/experimental/index.md
- Shared: - Shared:
- Inbound Listen Fields: configuration/shared/listen.md
- Outbound Dial Fields: configuration/shared/dial.md
- TLS: configuration/shared/tls.md - TLS: configuration/shared/tls.md
- Multiplex: configuration/shared/multiplex.md - Multiplex: configuration/shared/multiplex.md
- V2Ray Transport: configuration/shared/v2ray-transport.md - V2Ray Transport: configuration/shared/v2ray-transport.md
@ -150,6 +152,8 @@ plugins:
Protocol Sniff: 协议探测 Protocol Sniff: 协议探测
Experimental: 实验性 Experimental: 实验性
Shared: 通用 Shared: 通用
Inbound Listen Fields: 入站监听字段
Outbound Dial Fields: 出站拨号字段
Multiplex: 多路复用 Multiplex: 多路复用
V2Ray Transport: V2Ray 传输层 V2Ray Transport: V2Ray 传输层
Inbound: 入站 Inbound: 入站

View file

@ -223,7 +223,7 @@ func (w *WireGuard) ListenPacket(ctx context.Context, destination M.Socksaddr) (
} }
func (w *WireGuard) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error { func (w *WireGuard) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error {
return NewEarlyConnection(ctx, w, conn, metadata) return NewConnection(ctx, w, conn, metadata)
} }
func (w *WireGuard) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error { func (w *WireGuard) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error {