English
shadowsocks
Shadowsocks with AEAD ciphers and Shadowsocks 2022 (SIP022) ciphers, TCP and UDP. Compatible with sing-box, Xray and shadowsocks-rust shadowsocks for the same methods.
Methods
| Family | method | password |
|---|---|---|
| AEAD | aes-128-gcm, aes-256-gcm, chacha20-ietf-poly1305, xchacha20-ietf-poly1305 | any string |
| 2022 | 2022-blake3-aes-128-gcm | a 16-byte key in base64 |
| 2022 | 2022-blake3-aes-256-gcm, 2022-blake3-chacha20-poly1305 | a 32-byte key in base64 |
A 2022 key can be made with ours generate rand 16 --base64 (use 32 for a 32-byte key). Stream ciphers (rc4-md5, aes-*-ctr, aes-*-cfb, chacha20-ietf), none and aes-192-gcm (which sing-box has) are not supported.
Inbound
| Field | Type | Default | Meaning |
|---|---|---|---|
method | string | required | The encryption method |
password | string | required | The password; for multi-user 2022, the server key (iPSK) |
users | list of {name, password} | — | Multi-user mode: 2022 methods only, password is the user's key |
network | tcp, udp or a list | both | What to accept |
Socket settings are the listener block. Salt replay protection covers the whole process. The mux block enables accepting sing-mux. The inbound always understands UDP over TCP connections. There are no tls and transport blocks.
Not supported: destinations (relay), managed — not implemented yet.
Outbound
| Field | Type | Default | Meaning |
|---|---|---|---|
server | host:port | required | The server address |
method | string | required | The method |
password | string | required | The password/key; for a user of multi-user 2022, server_key:user_key |
network | tcp, udp or a list | both | What to pass |
plugin | {<name>: <options>} | — | A SIP003 plugin, see below |
udp_over_tcp | block | — | UDP inside the TCP connection, see udp_over_tcp |
Blocks: dial, mux. UDP goes to the server as separate UDP packets, with udp_over_tcp inside TCP.
Plugins
As in sing-box, the plugins are built in: no external process is started. The plugin's name is the key, its options are a SIP003 string (key=value separated by ;, \ escapes).
| Plugin | Options | What it does |
|---|---|---|
obfs-local (simple-obfs) | obfs=http (default) or tls; obfs-host=<name> | http: the first data is the body of a WebSocket upgrade request; tls: in the session ticket of a ClientHello, then TLS records |
v2ray-plugin | host (cloudfront.com by default), path (/), tls, cert=<path>, certRaw=<PEM without the frame>, mux=0 | WebSocket, with tls over TLS (the SNI is host); the stream goes in one mux.cool session unless mux=0 |
v2ray-plugin in mode=quic and other plugins are an error. The plugin carries only TCP; UDP goes to the same server address without it.
yaml
outbounds:
ss-obfs:
shadowsocks:
server: ss.example.com:8388
method: aes-256-gcm
password: secret
plugin:
obfs-local: obfs=tls;obfs-host=www.bing.comExample: a multi-user 2022 server
yaml
inbounds:
ss-in:
shadowsocks:
listen: ":8388"
method: 2022-blake3-aes-128-gcm
password: dPbOJ32Gm1iOmcGttUzeBQ==
users:
- name: alice
password: qy/172bxofI6z6QyNVcOxQ==
outbounds:
ss-out:
shadowsocks:
server: ss.example.com:8388
method: 2022-blake3-aes-128-gcm
password: dPbOJ32Gm1iOmcGttUzeBQ==:qy/172bxofI6z6QyNVcOxQ==
route:
final:
outbound: ss-outA minimal client:
yaml
outbounds:
ss:
shadowsocks:
server: ss.example.com:8388
method: chacha20-ietf-poly1305
password: secret
route:
final:
outbound: ssThe keys in the examples are for demonstration.
Module description for developers: modules/shadowsocks.