MonitoringPublished
VLESS vs VMess vs Trojan vs Shadowsocks: what each one does
VLESS, VMess, Trojan and Shadowsocks are all proxy protocols that carry TCP and UDP connections, and Xray-core runs all four. The real difference is what each protocol does itself. VMess and Shadowsocks encrypt their own traffic with a shared key. VLESS and Trojan only identify the user and leave all encryption to TLS or REALITY. For a new server today, VLESS over REALITY or TLS is the default choice, and Xray-core 26.x itself logs deprecation warnings for VMess, Trojan and Shadowsocks. Trojan still suits a simple setup with a real certificate and a website on port 443. Shadowsocks 2022 suits links that need no domain and no certificate.
ST Muntaha10 min read

On this page
Comparisons of these four protocols usually end in a ranking. I don't think a ranking helps an operator, because each protocol fails in its own way and fits a different network. This post compares what they actually do on the wire, what they need from you (a certificate, a correct clock, a domain), what they cost, how censors have treated them, and which clients support what. Each of them has its own explainer on this blog if you want the details: VLESS, Trojan and Shadowsocks 2022.
Versions I checked: Xray-core 26.10.31, sing-box 1.14.4 and the current Mihomo docs, at the end of October 2026.
Is Xray a protocol?
No. Xray-core is a program that implements protocols, so "Shadowsocks vs Xray" compares a protocol with a program. Xray-core, from Project X, grew out of V2Ray and still describes itself on GitHub as "the best v2ray-core". It speaks VLESS, VMess, Trojan, Shadowsocks and several others. sing-box and Mihomo are other programs that speak most of the same protocols. shadowsocks-rust speaks only Shadowsocks.
So when a panel such as 3x-ui or Marzban says it "runs Xray", it can serve any of the four protocols. The choice of protocol is a setting per inbound, and you can run several on one server.
What does each protocol do itself, and what does it leave to TLS?
This is the core difference. VMess and Shadowsocks were designed to run naked on the internet, so they carry their own encryption. VLESS and Trojan were designed to run inside TLS, so they carry only authentication.
| VLESS | VMess | Trojan | Shadowsocks 2022 | |
|---|---|---|---|---|
| Comes from | V2Ray 4.27 (2020); now developed in Xray-core | V2Ray | trojan-gfw | Shadowsocks, SIP022 |
| User is identified by | UUID | UUID, in an AEAD header with a timestamp | SHA224 hash of a password | The key itself; a user key with SIP023 |
| Encrypts by itself | No; optional VLESS Encryption since Xray-core 25.9.5 (stable) | Yes: AES-128-GCM or ChaCha20-Poly1305 | No | Yes: AES-GCM or ChaCha20-Poly1305 |
| Needs TLS or REALITY on the internet | Yes, unless VLESS Encryption is on | No | Yes | No |
| Forward secrecy | From TLS, or VLESS Encryption | No | From TLS | No |
| Clock must be right | No | Within 120 seconds | No | Within 30 seconds |
| Fallback to a website on the same port | Yes, in Xray | No | Yes, in Xray, sing-box and trojan-gfw | No |
| UDP | Inside the TCP stream | Inside the TCP stream | Inside the TCP stream | A separate UDP relay on the same port |
Xray-core enforces the "needs TLS" row. Since 26.7.11, a VLESS or Trojan client config with "security": "none" to a public address fails to load, for example with trojan without TLS is prohibited unless the server address is a private IP or domain. The same release removed VMess's none and zero security values (they now fall back to auto) and Shadowsocks's none method.
The forward secrecy row comes from Xray's own transport docs, which say Shadowsocks and VMess "protect the payload, but lack TLS 1.3-style forward secrecy". If a VMess UUID or a Shadowsocks key leaks, recorded traffic can be decrypted. With VLESS and Trojan, the TLS session keys protect recorded traffic, and a leaked UUID or password lets someone use your server, not read old traffic.
The clock row decides a whole class of support tickets. Xray's VMess docs say the client's UTC time must be within 120 seconds of the real time. Shadowsocks 2022 rejects anything more than 30 seconds off. VLESS and Trojan do not care, because TLS does not depend on the clock to this degree. TLS still needs a roughly correct date to validate a certificate.
How much overhead does each protocol add?
Little, and in a different place for each one. The numbers below come from each protocol's spec.
| Protocol | First message of a connection | Every later chunk of data |
|---|---|---|
| VLESS | About 22 bytes plus the destination address (no addons) | Nothing; TLS does the framing |
| Trojan | 64 bytes plus the address (56-byte hash, request, two CRLFs) | Nothing; TLS does the framing |
| VMess | An encrypted header with authentication | 2-byte length plus 16-byte tag, chunks up to 16 KB |
| Shadowsocks 2022 | A 16- or 32-byte salt, two encrypted header chunks, and 0 to 900 bytes of padding | 2-byte length plus two 16-byte tags, chunks up to 64 KB |
The header bytes do not matter much. What matters is encryption done twice. VMess is often deployed over WebSocket with TLS, which means every byte is encrypted by VMess and again by TLS. VLESS and Trojan inside TLS are encrypted once. Shadowsocks normally runs without TLS, so it is also encrypted once. On a small VPS pushing a lot of traffic, double encryption costs CPU; for a few users, you will not notice.
VLESS has one more option here, the xtls-rprx-vision flow. When the traffic inside the tunnel is itself TLS 1.3 (as most web traffic is), Vision avoids encrypting it a second time, and on Linux it can hand the data straight to the kernel. Xray's docs say Vision works on raw TCP with TLS or REALITY, or on any transport when VLESS Encryption is on. They also claim REALITY with Vision "can also deliver performance gains of several times or even more than ten times". I have not measured that myself, so treat it as the project's own number.
How have censors treated each protocol?
All four have been studied and blocked in some networks. What differs is what a censor has to do.
Shadowsocks and VMess look like random bytes. That was the design goal, and it became the weakness. A 2020 Internet Measurement Conference paper, "How China Detects and Blocks Shadowsocks", documented active probing of Shadowsocks servers. In November 2021 the Great Firewall began blocking "fully encrypted" traffic passively, in real time. The USENIX Security 2023 paper that measured it lists Shadowsocks, VMess and obfs4 among the affected protocols. It found the censor exempts traffic that looks like known protocols, or has many printable characters, and blocks the rest. Shadowsocks 2022 fixed replay and probing problems, but its traffic still looks random.
Old VMess had design problems of its own. The Xray share link standard says the old VMess, with alterId greater than 0, had fatal problems in its protocol design. Xray-core made the AEAD header mandatory on 1 January 2022 and removed the old MD5-based header in v1.8.3. If a link still carries aid or alterId values above 0, it is from that era.
Trojan and VLESS look like HTTPS from outside, but they depend on a certificate and an SNI that a censor can see, and the server's IP and domain can be blocked like any other. A USENIX Security 2024 paper showed that a TLS handshake carried inside another TLS connection can be recognised, which applies to any TLS-based proxy carrying HTTPS. Xray's response is different for the two protocols. For Trojan, its docs say Mux is required in public environments. For VLESS, the Vision flow pads the inner handshake. REALITY goes further: it borrows the TLS handshake of another, real website as camouflage, so you need no domain or certificate of your own.
None of this makes any protocol undetectable. It changes the cost of detecting it, and that is what you are choosing.
Which clients support each one?
Client apps inherit their protocol support from the core they embed: Xray-core, sing-box or Mihomo. Check which core and which version an app ships before you change protocols. From the current docs of each core:
| Feature | Xray-core 26.10.31 | sing-box 1.14.4 | Mihomo |
|---|---|---|---|
| VLESS | Yes | Yes | Yes |
VLESS xtls-rprx-vision flow |
Yes | Yes | Yes |
| VLESS Encryption | Yes | Not in its docs | Yes |
| REALITY | Yes | Yes | Yes |
| VMess (AEAD) | Yes | Yes | Yes |
VMess legacy (alterId above 0) |
Removed | Yes (alter_id: 1) |
Not checked |
| Trojan | Yes | Yes | Yes |
| Shadowsocks 2022 | Yes | Yes | Yes |
| XHTTP transport | Yes | Not in its transport list | Yes |
| Built-in Shadowsocks plugins | Not in its docs | obfs-local, v2ray-plugin |
obfs, v2ray-plugin, shadow-tls and others |
The rows where cores disagree are the ones that break subscriptions. A server you move to XHTTP or VLESS Encryption stops working for every sing-box user, even though the link looks valid. That is one good reason to keep more than one protocol in a subscription.
Which protocol should I use today?
For a new server in late 2026, start from what your users' network allows and what your clients support:
- Direct connection from users to the server: VLESS with REALITY and Vision on raw TCP. This is the setup Xray-core points everyone to. You need no domain and no certificate. The Xray deprecation warnings for the other three all suggest moving to VLESS. The VLESS explainer has a minimal config.
- The connection must pass through a CDN or share 443 with a website behind nginx: VLESS or Trojan over XHTTP, WebSocket or gRPC, with TLS. REALITY and Vision on raw TCP cannot pass through a CDN, because a CDN terminates TLS and forwards only HTTP.
- You already run Trojan with real certificates and a fallback website: it is fine to keep it. Xray-core 26.x prints
The feature Trojan (with no Flow, etc.) is deprecated, not recommended for using and might be removed, but the function behind that message is explicitly for features with no removal planned soon. Watch your certificate expiry, because a Trojan server with an expired certificate fails every client. - VMess: only for clients that cannot do anything else. It needs a correct clock, encrypts twice inside TLS, and Xray-core warns about it too. There is no reason to deploy it on a new server.
- Shadowsocks 2022: when you want no TLS, no domain and almost no setup. It is the lightest of the four, and shadowsocks-rust, sing-box and Mihomo all support it well. It is a good fit between your own servers, for example a relay to an exit node, and on networks that do not filter high-entropy traffic. On networks that do, it stands out by design.
VLESS vs Shadowsocks in one line: VLESS hides inside TLS and needs TLS or REALITY to be safe; Shadowsocks encrypts itself and looks random. Shadowsocks vs VMess: both encrypt themselves without forward secrecy, but Shadowsocks 2022 has the stricter replay protection and a simpler setup, and VMess is the older design.
How do I check a server with any of these protocols?
The same way for all four: with a real client and a real request. None of them answers a bad credential with a clear error. VLESS and Trojan pass a bad UUID or password to the fallback if you have one. Shadowsocks and VMess have no error message in the protocol, so a bad key looks like a broken connection. A TCP port check on any of them stays green when users can't connect.
For each protocol, run Xray-core or sing-box with the link's settings and a local SOCKS port, then:
curl -s -m 10 --socks5-hostname 127.0.0.1:1080 -o /dev/null -w '%{http_code}\n' https://www.gstatic.com/generate_204
A 204 means the protocol, the credentials and the server's outbound all work. The explainers have protocol-specific checks, such as a manual Trojan request with openssl in the Trojan post and a VLESS client config in the VLESS explainer.
Full disclosure: TunnelHQ checks all four this way, from outside your network. You paste a vless://, vmess://, trojan:// or ss:// link, or a subscription URL, and it completes the real handshake and sends requests through the tunnel every 1 to 5 minutes, depending on plan. VLESS monitoring explains the check, every plan starts with a 14-day free trial, and the free tester checks one link without an account.



