SHADOWSOCKS-LIBEV(8)
πΈ NAME πΈ
okay bestie, welcome to the Shadowsocks-libev Manual page for shadowsocks-libev β the lightweight and secure socks5 proxy, no cap. π
Itβs a port of the original shadowsocks created by clowwindy, and itβs written in pure C while taking advantage of libev to achieve both high performance and low resource consumption. β¨
β¨ SYNOPSIS β¨
The whole squad lines up like this, exactly:
ss-local|ss-redir|ss-server|ss-tunnel|ss-manager [-s <server_host>] [-p <server_port>] [-l <local_port>] [-k <password>] [-m <encrypt_method>] [-f <pid_file>] [-t <timeout>] [-c <config_file>]
π¦ DESCRIPTION π¦
shadowsocks-libev is literally a lightweight and secure socks5 proxy. Itβs a port of the original shadowsocks created by clowwindy, written in pure C, and it uses libev to get both high performance and low resource consumption. iconic behavior, honestly. π
The squad has five components. ss-server(1) runs on a remote server and provides the secured tunnel service. ss-local(1) and ss-redir(1) are clients on your local machines that proxy traffic (TCP/UDP or both). ss-tunnel(1) is the tool for local port forwarding. π«Ά
ss-local(1) works as a standard socks5 proxy, while ss-redir(1) works as a transparent proxy and requires netfilterβs NAT module. For more information, check out the EXAMPLE section, bestie. π₯
ss-manager(1) is the controller for multi-user management and traffic statistics, using a UNIX domain socket to talk with ss-server(1). It also provides a UNIX domain socket or IP based API for other software. For the details of this API, please refer to the PROTOCOL section. π
π OPTIONS π
Every flag, every caveat, every little detail β kept intact, fr fr:
-s <server_host>β sets the serverβs hostname or IP. π-l <local_port>β sets the local port number. Not available in server nor manager mode. π«-k <password>,--password <password>β sets the password. The server and the client should use the same password. π--key <key_in_base64>β sets the key directly. The key should be encoded with URL-safe Base64. Not available in manager mode. ποΈ-m <encrypt_method>β sets the cipher.shadowsocks-libevaccepts 19 different ciphers:aes-128-gcm,aes-192-gcm,aes-256-gcm,rc4-md5,aes-128-cfb,aes-192-cfb,aes-256-cfb,aes-128-ctr,aes-192-ctr,aes-256-ctr,bf-cfb,camellia-128-cfb,camellia-192-cfb,camellia-256-cfb,chacha20-ietf-poly1305,xchacha20-ietf-poly1305,salsa20,chacha20andchacha20-ietf. The default cipher ischacha20-ietf-poly1305. If built with PolarSSL or custom OpenSSL libraries, some of these ciphers may not work. π-a <user_name>β runs as a specific user. π€-f <pid_file>β startsshadowsocksas a daemon with a specific pid file. π§-t <timeout>β sets the socket timeout in seconds. The default value is60. β³-c <config_file>β uses a configuration file. π-n <number>β specifies the max number of open files. Not available in manager mode. Only available on Linux. π§-i <interface>β sends traffic through a specific network interface. For example, there are three interfaces on your device:lo(127.0.0.1),eth0(192.168.0.1) andeth1(192.168.0.2). Meanwhile, you configureshadowsocks-libevto listen on0.0.0.0:8388and bind toeth1. That results in the traffic going out througheth1, but notlonoreth0. This option is useful to control traffic in a multi-interface environment. Not available in redir mode. π°οΈ-b <local_address>β specifies the local address to bind. For servers: specify the local address to use while this server is making outbound connections to remote servers on behalf of the clients. For clients: specify the local address to use while this client is making outbound connections to the server. Not available in manager mode. π―-uβ enables UDP relay. TPROXY is required in redir mode. You may need root permission. β‘-Uβ enables UDP relay and disables TCP relay. Not available in local mode. π-Tβ uses tproxy instead of redirect (for tcp). Only available in redir mode. π-L <addr:port>β specifies the destination server address and port for local port forwarding. Only available in tunnel mode. π-d <addr>β sets up name servers for the internal DNS resolver (libc-ares). The default server is fetched from/etc/resolv.conf. Only available in server and manager mode. π§--fast-openβ enables TCP fast open. Not available in redir nor tunnel mode, with Linux kernel >3.7.0. π--reuse-portβ enables port reuse. Only available with Linux kernel >3.9.0. β»οΈ--no-delayβ enablesTCP_NODELAY. π¨--tcp-incoming-sndbuf <size>β sets the TCP send buffer size for incoming connections. Not available in manager mode. π₯--tcp-incoming-rcvbuf <size>β sets the TCP receive buffer size for incoming connections. Not available in manager mode. π¦--tcp-outgoing-sndbuf <size>β sets the TCP send buffer size for outgoing connections. Not available in manager mode. π€--tcp-outgoing-rcvbuf <size>β sets the TCP receive buffer size for outgoing connections. Not available in manager mode. π§Ί--acl <acl_config>β enables ACL (Access Control List) and specifies the config file. Not available in redir nor tunnel mode. π--manager-address <path_to_unix_domain>β specifies the UNIX domain socket address. Only available in server and manager mode. π--executable <path_to_server_executable>β specifies the executable path ofss-server. Only available in manager mode. π§-D <path>,--workdir <path>β specifies the working directory ofss-manager. Only available in manager mode. π--nftables-sets <family:table:set>β specifies nftables sets for reporting malicious IPs. Only available in server mode, when built with nftables support. π‘οΈ-vβ enables verbose mode. π£οΈ-h|--helpβ prints the help message. π
tiny note, bestie: -p <server_port> is in the synopsis above, but the original options list doesnβt give it its own description here β so Iβm not inventing one. π«Ά
π CONFIG FILE π
Okay so the config file is written in JSON, and bestie, it is so easy to edit. Like, genuinely. No cap. β¨
The config file equivalent of the command line options is listed as an example below π β one lil bullet per vibe, command line on the left, JSON on the right:
-s some.server.netβ"server": "some.server.net"-s some.server.net -p 1234(client) β"server": "some.server.net:1234"-p 1234β"server_port": "1234"-b 0.0.0.0β"local_address": "0.0.0.0"-b 10.0.0.2β"local_ipv4_address": "10.0.0.2"-b 2620:129:35::33β"local_ipv6_address": "2620:129:35::33"-l 4321β"local_port": "4321"-k "PasSworD"β"password": "PasSworD"-m "aes-256-cfb"β"method": "aes-256-cfb"-t 60β"timeout": 60-a nobodyβ"user": "nobody"--acl "/path/to/acl"β"acl": "/path/to/acl"--fast-openβ"fast_open": true--reuse-portβ"reuse_port": true--no-delayβ"no_delay": true--plugin "obfs-server"β"plugin": "obfs-server"--plugin-opts "obfs=http"β"plugin_opts": "obfs=http"-6β"ipv6_first": true-n "/etc/nofile"β"nofile": "/etc/nofile"-d "8.8.8.8"β"nameserver": "8.8.8.8"-L "somedns.net:53"β"tunnel_address": "somedns.net:53"-uβ"mode": "tcp_and_udp"-Uβ"mode": "udp_only"- no
-unor-Uoptions (default) β"mode": "tcp_only" -Tβ"tcp_tproxy": true- (only in ss-managerβs config) β
"port_password": {"1234":"PasSworD"}
π Eyes on that last one β port_password is only a thing in ss-managerβs config. Don't come for me, I'm just the messenger π«Ά
π EXAMPLE π
So ss-redir requires netfilter's NAT function β that's the whole vibe check it needs to pass. Here is an example π
:
# Create new chain
iptables -t nat -N SHADOWSOCKS
iptables -t mangle -N SHADOWSOCKS
# Ignore your shadowsocks server's addresses
# It's very IMPORTANT, just be careful.
iptables -t nat -A SHADOWSOCKS -d 123.123.123.123 -j RETURN
# Ignore LANs and any other addresses you'd like to bypass the proxy
# See Wikipedia and RFC5735 for full list of reserved networks.
# See ashi009/bestroutetb for a highly optimized CHN route list.
iptables -t nat -A SHADOWSOCKS -d 0.0.0.0/8 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 10.0.0.0/8 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 127.0.0.0/8 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 169.254.0.0/16 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 172.16.0.0/12 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 192.168.0.0/16 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 224.0.0.0/4 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 240.0.0.0/4 -j RETURN
# Anything else should be redirected to shadowsocks's local port
iptables -t nat -A SHADOWSOCKS -p tcp -j REDIRECT --to-ports 12345
# Add any UDP rules
ip rule add fwmark 0x01/0x01 table 100
ip route add local 0.0.0.0/0 dev lo table 100
iptables -t mangle -A SHADOWSOCKS -p udp --dport 53 -j TPROXY --on-port 12345 --tproxy-mark 0x01/0x01
# Apply the rules
iptables -t nat -A PREROUTING -p tcp -j SHADOWSOCKS
iptables -t mangle -A PREROUTING -j SHADOWSOCKS
# Start the shadowsocks-redir
ss-redir -u -c /etc/config/shadowsocks.json -f /var/run/shadowsocks.pid
π Real talk though β that 123.123.123.123 line is very IMPORTANT, so just be careful, okay? Like actually. Don't skip it. π₯
π°οΈ PROTOCOL (the actual fun part)
okay so ss-manager(1) is literally serving several APIs through a UDP protocol and honestly? iconic. here's the whole vibe π
Send UDP commands in this exact format to the manager-address you handed to ss-manager(1):
command: [JSON data]
that's it, that's the whole handshake bestie π like, command, colon, JSON. periodt.
π To add a port
add: {"server_port": 8001, "password":"7cd308cc059"}
boom, new port, slay β¨ (copy that JSON exactly, the quotes and spacing are doing the lord's work)
ποΈ To remove a port
remove: {"server_port": 8001}
bye bye port, you had a good run π«Ά
π To receive a pong
ping
no JSON, no drama, just vibes. it's giving "just checking in" π
Then β and this is the good part β ss-manager(1) will send back the traffic statistics:
stat: {"8001":11370}
like it literally reports back with the numbers, main character energy fr fr π₯ (the key is the port, the value is the traffic stat β that's the shape of it, iykyk)
β οΈ heads up bestie: this is all UDP. no TCP, no retries, no little helping hand catching your packet if it gets lost. keep that in mind before you go trusting every ping π
π SEE ALSO
go read the rest of the family, they're all icons in their own right π
ss-local(1)ss-server(1)ss-tunnel(1)ss-redir(1)ss-manager(1)iptables(8)/etc/shadowsocks-libev/config.json
okay that's the whole page bestie, you made it to the end ππ go forth and configure responsibly. this one's Shadowsocks-libev 3.3.6, dated 10/11/2026 β so yes, future-dated manual page, we stan a time traveler β no cap. mwah ππΈ
π¦ where this page comes from
- opensuse-leap 16.0: shadowsocks-libev 3.3.6-bp160.3.1 Β· GPL-3.0-or-later
- opensuse-leap 16.0: shadowsocks-libev 3.3.6-bp160.3.1 Β· GPL-3.0-or-later
- opensuse-leap 16.0: shadowsocks-libev 3.3.6-bp160.3.1 Β· GPL-3.0-or-later
- opensuse-leap 16.0: shadowsocks-libev 3.3.6-bp160.3.1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms