Protocols

Shadowsocks: how it works, 2022 edition and which app to use

Shadowsocks is a lightweight encrypted proxy, first released in 2012, that carries your traffic to a server as a stream of random-looking bytes. With AEAD ciphers, both the data and the proxy’s control fields are protected, and the 2022 edition adds replay protection, defences against active probing and stricter key handling. It is fast and simple to run, but traffic that matches no known protocol at all can itself stand out on some networks.

Published 26 November 202610 min readBy the Phoenix VPN team

Shadowsocks illustration: a connection line enters a stack of layered squares, turns into a dashed stream inside and comes out the other side
On this page

What Shadowsocks is

Shadowsocks started in 2012 as an open-source project; the original Python version’s changelog dates its first release to April that year. Today it is a family of compatible implementations, including shadowsocks-rust, which also powers the official Android app, and the ones built into Xray and sing-box.

The documentation calls it “a secure split proxy loosely based on SOCKS5” (What is Shadowsocks). A local part on your device takes connections from your apps, encrypts them and sends them to the remote part on a server, which decrypts each request, connects to the site you asked for and relays the replies. There is no handshake and no certificate: both sides share a key in advance, which keeps the protocol small and quick.

Strictly speaking, that makes Shadowsocks a proxy rather than a VPN. People still talk about a “Shadowsocks VPN” because many client apps offer a VPN mode that sends all of a device’s traffic through the proxy.

How Shadowsocks encryption works

Two cipher families matter here, especially for older setups.

Stream ciphers: the original design

Early versions used stream ciphers such as aes-256-cfb or rc4-md5. They hide the content but cannot detect whether anyone has changed it on the way. The project now calls them “completely broken” and keeps their description for educational purposes only (stream ciphers). If an old config or link uses one, replace it.

AEAD ciphers: the 2017 standard

The fix was AEAD (authenticated encryption with associated data), standardised in 2017. The AEAD specification lists chacha20-ietf-poly1305, aes-256-gcm and aes-128-gcm, which provide confidentiality, integrity and authenticity at once.

Each connection starts with a random salt, which both sides combine with the shared key to derive a fresh session key. The stream is then cut into chunks: an encrypted length and an encrypted payload, each with its own authentication tag. The first chunk carries the address of the site you want to reach. With AEAD ciphers, both the data and the proxy’s control fields are protected: if anyone alters a single byte, decryption fails and the data is rejected.

AEAD left gaps, though. The key is usually derived from a password, so a short password means a weak key, and replay protection was left to each implementation.

What Shadowsocks 2022 adds

The Shadowsocks 2022 specification, known as SIP022, builds on AEAD and “addresses well-known issues of the previous editions”. Every implementation must support 2022-blake3-aes-128-gcm and 2022-blake3-aes-256-gcm; 2022-blake3-chacha20-poly1305 is an optional extra for processors without AES instructions. shadowsocks-rust, Xray and sing-box all support these ciphers.

Replay protection

In a replay attack, someone records a real connection and sends the same bytes to the server again. The data is valid, so a classic server may accept it, and a prober can use the reaction to confirm it is a proxy (Outline’s notes on probes and replays). Shadowsocks 2022 makes replay protection mandatory:

  • Every request carries a timestamp, and one more than 30 seconds off is treated as a replay.
  • The server remembers each salt for 60 seconds and refuses any repeat.
  • Messages are marked as client or server, so a recorded reply can’t be sent back as a request.
  • UDP runs in sessions with packet counters, checked by a sliding-window filter like WireGuard’s.

Protection against active probing

Active probing means connecting to a suspected server and studying how it reacts. One documented probe sends different numbers of random bytes and counts how many the server reads before it closes the connection, a number that can identify the server software. SIP022 removes that signal. The server must read the salt and fixed-length header in one go, and if anything fails, it must not reveal how many bytes it consumed. It cannot simply close the socket either, because the reset that follows gives the count away, so the spec lists ways to end such connections consistently.

Both sides must send the salt and headers in a single write, because separate writes “can result in predictable packet sizes”, and a request with no data yet gets random padding.

Stronger key handling

Shadowsocks 2022 drops passwords. You supply a random key of exactly the cipher’s size, encoded in base64: 16 bytes for 2022-blake3-aes-128-gcm, 32 bytes for the AES-256 and ChaCha20 variants. Deriving keys from passwords is forbidden, and session keys now come from BLAKE3 instead of HKDF-SHA1. The spec says the change was inspired by WireGuard and suggests openssl rand -base64 16 (or 32) to make a key; shadowsocks-rust also has ssservice genkey -m "2022-blake3-aes-128-gcm".

Two limits remain: there is still no forward secrecy, so anyone who later obtains the key can decrypt traffic they recorded, and the server and every client must use the same 2022 method.

What a network observer sees

To someone watching the network, a Shadowsocks connection has no visible structure: no handshake, no readable server name, no protocol header. SIP022 says the traffic “is indistinguishable from a random byte stream”, so filters that look for known signatures with deep packet inspection (DPI) have nothing to match. What stays visible is metadata: the server’s IP address and port, packet sizes and timing, and how much data flows. Shadowsocks on its own does not imitate HTTPS and does not rule out recognition by traffic behaviour.

Why random-looking traffic can stand out

Most internet traffic starts with something recognisable, such as a TLS handshake, a QUIC header or a DNS query. A long connection to a hosting provider’s address in which even the first bytes look like noise is unusual, and some DPI systems treat “matches no known protocol” as a reason to block or slow a connection. Matching no signature is not the same as blending in.

Some tools work around this. The Outline SDK can add a short prefix to each connection, which its code calls “useful to change how shadowsocks traffic is classified by middleboxes” (Outline SDK). SIP003 plugins such as v2ray-plugin can wrap Shadowsocks in WebSocket over TLS, though they carry TCP only. VLESS + REALITY instead imitates ordinary HTTPS from the start.

Your connection

  1. Your deviceEncrypts traffic with the shared key
  2. The networkSees random-looking bytes with no recognisable protocol
  3. Shadowsocks serverDecrypts, checks and forwards your request
  4. InternetYour traffic goes on from here

A probe (2022 edition)

  1. A probeSends random data or replays recorded traffic
  2. Shadowsocks serverRejects it: no reply, no clue how much it read
  3. Nothing to recogniseThe probe gets no proxy-like answer to match
How Shadowsocks looks from the outside: the network sees random-looking bytes, and with the 2022 edition a probe gets nothing proxy-like back.

Where Shadowsocks works and where it doesn’t

Shadowsocks tends to help on networks that block VPN protocols by their signatures, such as the standard WireGuard handshake, but let unclassified traffic through. That can include office, school or hotel Wi-Fi, mobile networks and countries that filter traffic with DPI. Its limits:

  • Random-looking traffic can be a signal. Networks that block what they cannot classify may single it out.
  • Your server’s IP is still visible. Shadowsocks hides the content, not the destination, so the IP can be blocked or land on a reputation list.
  • Old setups are weaker. Stream ciphers, short passwords and servers without replay or probe defences are easier to confirm and block.
  • UDP may not get through. Shadowsocks relays UDP for calls and games, but some networks block or throttle it.
  • Allowlist networks are a different problem. If a network only allows approved destinations, no protocol reaches a server that isn’t on the list.

Results depend on the server, its settings and how the network filters traffic.

Most people meet Shadowsocks as a link or a QR code. The SIP002 URI scheme packs a server profile into one line: cipher, password or key, server, port, an optional plugin and a name after the #. Two examples from the spec:

ss://YWVzLTEyOC1nY206dGVzdA@192.168.100.1:8888#Example1
ss://2022-blake3-aes-256-gcm:YctPZ6U7xPPcU%2Bgp3u%2B0tx%2FtRizJN9K8y%2BuKlW2qjlI%3D@192.168.100.1:8888#Example3

In the first, the part before the @ is base64 and decodes to aes-128-gcm:test, the cipher and the password. Base64 is encoding, not encryption; the spec says it never tries to “encrypt” your key. For 2022 links base64 is not allowed there, so the method and key appear as percent-encoded text, and a link starting with ss://2022-blake3- tells you at once that your app needs Shadowsocks 2022 support. Older links encode everything between ss:// and the # in base64 (config format), and SIP008 subscription URLs deliver whole server lists over HTTPS.

Treat an ss:// link like a password: anyone who has it can use the server and read the key. Don’t paste it into online decoders or QR code generators. If someone else gave you the link, remember that whoever runs the server can see which sites you connect to.

Which app to use

Any Shadowsocks client must support the cipher your server uses. These open-source apps open ss:// links; the last column, checked in each project’s source code, shows 2022 support.

App Platforms Shadowsocks 2022
Shadowsocks for Android Android, Android TV Yes
v2rayNG Android Yes
v2rayN Windows, macOS, Linux Yes
Hiddify Android, iOS, Windows, macOS, Linux Yes, through sing-box
Outline Client Windows, macOS, iOS, Android, Linux No: original AEAD ciphers only
Shadowsocks for Windows Windows No: AEAD and older ciphers only

On iPhone and iPad, paid closed-source apps such as Shadowrocket are also common.

Pros and cons

Pros

  • Light and fast, with little overhead; small enough for routers.
  • No recognisable signature, and AEAD protects both data and control fields.
  • The 2022 edition adds mandatory replay protection, probe resistance and random keys.

Cons

  • Fully random-looking traffic can itself stand out, and it doesn’t imitate HTTPS on its own.
  • No forward secrecy, and the server’s IP can still be blocked.
  • Older setups often use weak ciphers or passwords, and not every client supports 2022.
  • Self-hosting means you handle the server, keys, updates and IP changes yourself.

Set up Shadowsocks yourself or use an app

A Shadowsocks server is one of the simpler things to host yourself: one port, one key, no certificates. Here is what each route takes.

Set it up yourself Phoenix VPN
Server Rent a VPS outside the restricted network and keep it patched Phoenix’s dedicated servers, nothing to rent
Server software Install shadowsocks-rust (ssserver), Xray or sing-box, and open the port for TCP and UDP The Phoenix VPN app
Cipher Pick a 2022 cipher such as 2022-blake3-aes-128-gcm, or an AEAD cipher if some apps lack 2022 support Nothing to configure; Phoenix uses current settings and keeps them up to date
Keys and links Generate a random base64 key of the right length, then send ss:// links or QR codes privately to each device Nothing to configure
Client apps Install a client that supports your cipher, import the link, keep it updated VPN apps for Windows, Android and Android TV; iPhone/iPad and macOS coming soon
Updates and IP changes Patch the server and apps yourself; if the IP gets blocked, move to a new server and send everyone new links Smart Connection checks which protocols get through on your network, picks the best country and connects; a blocked server IP is replaced on Phoenix’s side
Other protocols Each extra protocol means more setup and another profile VLESS + REALITY, Hysteria2, Shadowsocks and WireGuard, all in every plan
Logs You decide what your server logs; you also rely on your hosting provider No activity logs: browsing history, DNS queries and traffic content are not stored
Devices As many as your server and setup handle Ember 3, Phoenix 6, Inferno 10
Time to connect Often an hour or so the first time, depending on experience Install the app, then one tap

Shadowsocks compared with other protocols

No protocol wins on every network. The table shows typical behaviour; real results depend on configuration and the network. For a broader overview, see VPN protocols compared.

Protocol Transport What a network observer sees What a probe without the key gets Best for
Shadowsocks (AEAD) TCP and UDP Random-looking bytes with no recognisable protocol Depends on the implementation Apps and servers that can’t use the 2022 ciphers
Shadowsocks 2022 TCP and UDP Random-looking bytes with no recognisable protocol No proxy-like reply; replays are rejected Low-overhead proxying where random-looking traffic isn’t suspicious
VLESS + REALITY TCP A TLS 1.3 connection to a well-known website The real website’s certificate and pages Networks that spot VPN and proxy protocols but allow ordinary HTTPS
Hysteria2 UDP (QUIC) Traffic that looks like HTTP/3; random-looking UDP with Salamander What looks like an ordinary HTTP/3 web server Speed on lossy or mobile links where UDP isn’t throttled
WireGuard UDP A recognisable WireGuard handshake and packet format No reply to packets without valid keys Speed on networks that don’t block VPNs

For each project’s own description, see SIP022, the REALITY README, the Hysteria 2 protocol and the WireGuard whitepaper.

If you’d rather not run a server, generate keys or pass links around, Phoenix VPN, an obfuscated VPN for networks that block VPNs, includes Shadowsocks alongside VLESS + REALITY, Hysteria2 and WireGuard in every plan. Smart Connection checks which protocols get through on your network, picks the best country and connects in one tap, and you can still choose the protocol and country yourself. To test it on your own network, the Phoenix and Inferno plans come with a 3-day free trial, and you can cancel anytime. Compare plans or download Phoenix VPN.

Frequently asked questions

Is Shadowsocks a VPN?

Not strictly. Shadowsocks is an encrypted proxy that carries the connections your apps hand to it. Many client apps add a VPN mode that sends all of a device's traffic through it, so in daily use it can work much like a VPN.

Is Shadowsocks secure?

With an AEAD or 2022 cipher and a strong random key, traffic between you and the server is encrypted and protected against tampering. Avoid old stream ciphers such as aes-256-cfb or rc4-md5. Shadowsocks has no forward secrecy, and whoever runs the server can see which sites you connect to.

Can Shadowsocks be detected or blocked?

Yes. It has no fixed signature, but the server's IP can be blocked, traffic that looks fully random can draw attention on some networks, and traffic volume and timing can be analysed. The 2022 edition makes a server much harder to confirm by probing, but it cannot prevent an IP block.

How do I open an ss:// link?

Copy the link or scan its QR code in a Shadowsocks-compatible app, such as Shadowsocks for Android, v2rayNG, v2rayN or Hiddify. If the link starts with ss://2022-blake3-, the app must support Shadowsocks 2022. Keep the link private: it contains the server's key.

What is the difference between Shadowsocks and Shadowsocks 2022?

Shadowsocks 2022 (SIP022) keeps the encrypted-stream design but replaces passwords with random fixed-length keys, makes replay protection mandatory, tells servers how to fail without giving probes anything to measure and redesigns UDP. The server and every client must use the same 2022 cipher.

Phoenix VPN team · Written and fact-checked by the people who build Phoenix VPN.

Skip the setup
One tap to a protocol that works

Smart Connection checks which protocols get through on your network, picks the best country and connects. Phoenix and Inferno plans come with a 3-day free trial.