2022-07-08 10:10:39 +00:00
|
|
|
|
`socks` inbound is a socks4, socks4a, socks5 server.
|
|
|
|
|
|
|
|
|
|
### Structure
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"inbounds": [
|
|
|
|
|
{
|
|
|
|
|
"type": "socks",
|
|
|
|
|
"tag": "socks-in",
|
|
|
|
|
|
|
|
|
|
"listen": "::",
|
|
|
|
|
"listen_port": 2080,
|
|
|
|
|
"tcp_fast_open": false,
|
|
|
|
|
"sniff": false,
|
|
|
|
|
"sniff_override_destination": false,
|
|
|
|
|
"domain_strategy": "prefer_ipv6",
|
2022-08-23 15:15:56 +00:00
|
|
|
|
"proxy_protocol": false,
|
|
|
|
|
|
2022-07-08 10:10:39 +00:00
|
|
|
|
"users": [
|
|
|
|
|
{
|
|
|
|
|
"username": "admin",
|
|
|
|
|
"password": "admin"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2022-08-24 10:43:39 +00:00
|
|
|
|
### SOCKS Fields
|
2022-08-23 15:15:56 +00:00
|
|
|
|
|
|
|
|
|
#### users
|
|
|
|
|
|
|
|
|
|
SOCKS users.
|
|
|
|
|
|
|
|
|
|
No authentication required if empty.
|
|
|
|
|
|
2022-08-24 10:43:39 +00:00
|
|
|
|
### 监听字段
|
2022-07-08 10:10:39 +00:00
|
|
|
|
|
|
|
|
|
#### listen
|
|
|
|
|
|
2022-08-24 10:43:39 +00:00
|
|
|
|
==必填==
|
2022-07-09 01:26:50 +00:00
|
|
|
|
|
2022-08-24 10:43:39 +00:00
|
|
|
|
监听地址
|
2022-07-08 10:10:39 +00:00
|
|
|
|
|
|
|
|
|
#### listen_port
|
|
|
|
|
|
2022-08-24 10:43:39 +00:00
|
|
|
|
==必填==
|
2022-07-09 01:26:50 +00:00
|
|
|
|
|
2022-08-24 10:43:39 +00:00
|
|
|
|
监听端口
|
2022-07-08 10:10:39 +00:00
|
|
|
|
|
|
|
|
|
#### tcp_fast_open
|
|
|
|
|
|
2022-08-24 10:43:39 +00:00
|
|
|
|
为监听器启用 TCP 快速打开
|
2022-07-08 10:10:39 +00:00
|
|
|
|
|
|
|
|
|
#### sniff
|
|
|
|
|
|
2022-08-24 10:43:39 +00:00
|
|
|
|
启用协议探测。
|
2022-07-08 10:10:39 +00:00
|
|
|
|
|
2022-08-24 10:43:39 +00:00
|
|
|
|
参阅 [协议探测](/zh/configuration/route/sniff/)
|
2022-07-08 10:10:39 +00:00
|
|
|
|
|
|
|
|
|
#### sniff_override_destination
|
|
|
|
|
|
2022-08-24 10:43:39 +00:00
|
|
|
|
用探测出的域名覆盖连接目标地址。
|
2022-07-08 10:10:39 +00:00
|
|
|
|
|
2022-08-24 10:43:39 +00:00
|
|
|
|
如果域名无效(如 Tor),将不生效。
|
2022-07-08 10:10:39 +00:00
|
|
|
|
|
|
|
|
|
#### domain_strategy
|
|
|
|
|
|
2022-08-24 10:43:39 +00:00
|
|
|
|
可选值: `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
|
2022-07-08 10:10:39 +00:00
|
|
|
|
|
2022-08-24 10:43:39 +00:00
|
|
|
|
如果设置,请求的域名将在路由之前解析为 IP。
|
2022-07-08 10:10:39 +00:00
|
|
|
|
|
2022-08-24 10:43:39 +00:00
|
|
|
|
如果 `sniff_override_destination` 生效,它的值将作为后备。
|
2022-07-08 10:10:39 +00:00
|
|
|
|
|
2022-08-23 15:15:56 +00:00
|
|
|
|
#### proxy_protocol
|
2022-07-08 10:10:39 +00:00
|
|
|
|
|
2022-08-24 10:43:39 +00:00
|
|
|
|
解析连接头中的 [代理协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)。
|