English
socks
SOCKS4, SOCKS4a and SOCKS5. Compatible with sing-box socks.
Inbound
One TCP port for all three versions: CONNECT, and for SOCKS5 UDP ASSOCIATE (UDP packets through a separate UDP socket). Understands sing-box UDP-over-TCP (a connection to sp.v2.udp-over-tcp.arpa, or v1 sp.udp-over-tcp.arpa; see udp_over_tcp).
| Field | Type | Default | Meaning |
|---|---|---|---|
users | list of {username, password} | — | SOCKS5 login and password; without the list the inbound is open |
Socket settings are the listener block; its udp.timeout applies to UDP sessions. There are no tls and transport blocks. The domain_resolver field is not supported: startup ends with the error domain_resolver: not implemented yet.
Outbound
| Field | Type | Default | Meaning |
|---|---|---|---|
server | host:port | required | The SOCKS server address |
version | 4, "4a", 5 (a number or a string) | 5 | The protocol version |
username, password | string | — | Authentication (SOCKS4 only username) |
network | tcp, udp or a list | both | What to pass through this outbound |
udp_over_tcp | block | — | UDP inside TCP: udp_over_tcp |
UDP goes through SOCKS5 UDP ASSOCIATE or, with udp_over_tcp, inside the TCP connection. SOCKS4 has no UDP of its own; with udp_over_tcp UDP still works over it.
Block: dial. There is no tls block.
Example
yaml
inbounds:
socks-in:
socks:
listen: 0.0.0.0:1080
users:
- username: user
password: pass
outbounds:
upstream:
socks:
server: 192.0.2.10:1080
version: "5"
username: corp
password: secret
udp_over_tcp: {}
route:
final:
outbound: upstreamA minimal outbound:
yaml
outbounds:
upstream:
socks:
server: 127.0.0.1:1080
route:
final:
outbound: upstreamModule description for developers: modules/socks.