English
shadowtls
ShadowTLS v1, v2, v3. The client performs a real TLS handshake with a real site (handshake); the ShadowTLS server forwards it and only watches; after the handshake the traffic of the inner protocol goes over the same connection — unwrapped (v1), in application data records (v2) or in records signed with HMAC (v3). To an observer this is a TLS session with a real site. Compatible with sing-box shadowtls.
ShadowTLS itself does not carry a destination address: it is a wrapper for another protocol, usually Shadowsocks:
- on the server, the
shadowtlsinbound hands the decrypted connection to the inbound given indetour; - on the client, the
shadowtlsoutbound only establishes the connection to the server, and another outbound goes through it withdial.detour.
Inbound
| Field | Type | Default | Meaning |
|---|---|---|---|
version | 1, 2, 3 | 1 | The protocol version |
password | string | — | The password (v2) |
users | list of {name, password} | — | Users (v3, required) |
handshake | block | required, except with wildcard_sni | The site for the handshake: server: host:port and an optional dial block (interface, fwmark, detour…) |
handshake.by_sni | mapping "SNI → a block like handshake" | — | A separate site for particular SNIs; the sing-box handshake_for_server_name is an error with a hint |
strict_mode | bool | false | v3: strict mode, like sing-box strict_mode |
wildcard_sni | off, authed, all | off | Handshake with the site from the client's SNI (port 443): authed only for those who passed the check, all for everyone |
detour | inbound name | — | Where to hand the connection after the handshake; a name that does not exist is a build error |
Socket settings are the listener block. The inbound has no tls block: TLS is run by the real site.
Outbound
| Field | Type | Default | Meaning |
|---|---|---|---|
server | host:port | required | The ShadowTLS server address |
version | 1, 2, 3 | 1 | The version |
password | string | — | The password (v2) or the user's password (v3) |
The tls block is required: sni is the name of the site from the server's handshake. v1 forces TLS 1.2; v3 requires uTLS and without a utls block takes the chrome fingerprint. The dial block works as usual.
Example: Shadowsocks over ShadowTLS v3
Server:
yaml
inbounds:
shadowtls-in:
shadowtls:
listen: ":443"
version: 3
users:
- name: alice
password: shadow-secret
handshake:
server: www.example.com:443
detour: ss-in
ss-in:
shadowsocks:
listen: 127.0.0.1:8388
method: 2022-blake3-aes-128-gcm
password: dPbOJ32Gm1iOmcGttUzeBQ==
outbounds:
direct:
direct:
route:
final:
outbound: directClient:
yaml
outbounds:
ss:
shadowsocks:
method: 2022-blake3-aes-128-gcm
password: dPbOJ32Gm1iOmcGttUzeBQ==
dial:
detour: shadowtls-out
shadowtls-out:
shadowtls:
server: st.example.com:443
version: 3
password: shadow-secret
tls:
sni: www.example.com
utls:
fingerprint: chrome
route:
final:
outbound: ssss has no server: the connection is established by shadowtls-out anyway.
The site's address here is written as
server: host:port, as in REALITY (handshake.server); a separateserver_portis an error.