2022-08-24 18:43:39 +08:00
|
|
|
|
### 结构
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"inbounds": [
|
|
|
|
|
{
|
|
|
|
|
"type": "trojan",
|
|
|
|
|
"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": [
|
|
|
|
|
{
|
|
|
|
|
"name": "sekai",
|
|
|
|
|
"password": "8JCsPssfgS8tiRwiMlhARg=="
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"tls": {},
|
|
|
|
|
"fallback": {
|
2022-08-25 13:35:48 +08:00
|
|
|
|
"server": "127.0.0.1",
|
2022-08-24 18:43:39 +08:00
|
|
|
|
"server_port": 8080
|
|
|
|
|
},
|
2022-08-25 13:35:48 +08:00
|
|
|
|
"fallback_for_alpn": {
|
|
|
|
|
"http/1.1": {
|
|
|
|
|
"server": "127.0.0.1",
|
|
|
|
|
"server_port": 8081
|
|
|
|
|
}
|
|
|
|
|
},
|
2022-08-24 18:43:39 +08:00
|
|
|
|
"transport": {}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Trojan 字段
|
|
|
|
|
|
|
|
|
|
#### users
|
|
|
|
|
|
|
|
|
|
==必填==
|
|
|
|
|
|
2022-08-25 09:45:22 +08:00
|
|
|
|
Trojan 用户。
|
2022-08-24 18:43:39 +08:00
|
|
|
|
|
|
|
|
|
#### tls
|
|
|
|
|
|
|
|
|
|
==如果启用 HTTP3 则必填==
|
|
|
|
|
|
2022-08-25 09:45:22 +08:00
|
|
|
|
TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
|
2022-08-24 18:43:39 +08:00
|
|
|
|
|
|
|
|
|
#### fallback
|
|
|
|
|
|
|
|
|
|
!!! error ""
|
|
|
|
|
|
|
|
|
|
没有证据表明 GFW 基于 HTTP 响应检测并阻止木马服务器,并且在服务器上打开标准 http/s 端口是一个更大的特征。
|
|
|
|
|
|
2022-08-25 13:35:48 +08:00
|
|
|
|
回退服务器配置。如果 `fallback` 和 `fallback_for_alpn` 为空,则禁用回退。
|
|
|
|
|
|
|
|
|
|
#### fallback_for_alpn
|
|
|
|
|
|
|
|
|
|
为 ALPN 指定回退服务器配置。
|
|
|
|
|
|
|
|
|
|
如果不为空,ALPN 不在此列表中的 TLS 回退请求将被拒绝。
|
2022-08-24 18:43:39 +08:00
|
|
|
|
|
|
|
|
|
#### transport
|
|
|
|
|
|
|
|
|
|
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。
|
|
|
|
|
|
|
|
|
|
### 监听字段
|
|
|
|
|
|
|
|
|
|
#### listen
|
|
|
|
|
|
|
|
|
|
==必填==
|
|
|
|
|
|
2022-08-25 09:45:22 +08:00
|
|
|
|
监听地址。
|
2022-08-24 18:43:39 +08:00
|
|
|
|
|
|
|
|
|
#### listen_port
|
|
|
|
|
|
|
|
|
|
==必填==
|
|
|
|
|
|
2022-08-25 09:45:22 +08:00
|
|
|
|
监听端口。
|
2022-08-24 18:43:39 +08:00
|
|
|
|
|
|
|
|
|
#### tcp_fast_open
|
|
|
|
|
|
2022-08-25 09:45:22 +08:00
|
|
|
|
为监听器启用 TCP 快速打开。
|
2022-08-24 18:43:39 +08:00
|
|
|
|
|
|
|
|
|
#### sniff
|
|
|
|
|
|
|
|
|
|
启用协议探测。
|
|
|
|
|
|
2022-08-25 09:45:22 +08:00
|
|
|
|
参阅 [协议探测](/zh/configuration/route/sniff/)。
|
2022-08-24 18:43:39 +08:00
|
|
|
|
|
|
|
|
|
#### sniff_override_destination
|
|
|
|
|
|
|
|
|
|
用探测出的域名覆盖连接目标地址。
|
|
|
|
|
|
|
|
|
|
如果域名无效(如 Tor),将不生效。
|
|
|
|
|
|
|
|
|
|
#### domain_strategy
|
|
|
|
|
|
2022-08-25 09:45:22 +08:00
|
|
|
|
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
2022-08-24 18:43:39 +08:00
|
|
|
|
|
|
|
|
|
如果设置,请求的域名将在路由之前解析为 IP。
|
|
|
|
|
|
|
|
|
|
如果 `sniff_override_destination` 生效,它的值将作为后备。
|
|
|
|
|
|
|
|
|
|
#### proxy_protocol
|
|
|
|
|
|
|
|
|
|
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。
|