sing-box/docs/configuration/inbound/socks.md

80 lines
1.3 KiB
Markdown
Raw Normal View History

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"
}
]
}
]
}
```
### SOCKS Fields
2022-08-23 15:15:56 +00:00
#### users
SOCKS users.
No authentication required if empty.
### Listen Fields
2022-07-08 10:10:39 +00:00
#### listen
==Required==
Listen address.
2022-07-08 10:10:39 +00:00
#### listen_port
==Required==
Listen port.
2022-07-08 10:10:39 +00:00
#### tcp_fast_open
Enable tcp fast open for listener.
2022-07-08 10:10:39 +00:00
#### sniff
Enable sniffing.
2022-07-08 10:10:39 +00:00
See [Protocol Sniff](/configuration/route/sniff/) for details.
2022-07-08 10:10:39 +00:00
#### sniff_override_destination
Override the connection destination address with the sniffed domain.
2022-07-08 10:10:39 +00:00
If the domain name is invalid (like tor), this will not work.
2022-07-08 10:10:39 +00:00
#### domain_strategy
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
2022-07-08 10:10:39 +00:00
If set, the requested domain name will be resolved to IP before routing.
2022-07-08 10:10:39 +00:00
If `sniff_override_destination` is in effect, its value will be taken as a fallback.
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
Parse [Proxy Protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) in the connection header.