V2Ray and Xray Explained: Cores, Protocols and Transports
V2Ray and Xray aren't protocols: they're platforms that run protocols like VLESS and VMess over transports like WebSocket. How the pieces fit together, and how the two projects differ.
في هذه الصفحة
هذا المقال غير متوفر بالعربية بعد، لذا يظهر بلغته الأصلية، وهي الإنجليزية.
"V2Ray" shows up in VPN app server lists next to protocol names, so it's easy to assume it's a protocol too. It isn't. V2Ray, and Xray, which grew out of it, are platforms: programs that accept connections, decide where they go, and send them on with whichever protocol and transport they're configured to use. This guide explains those layers and how the two projects differ.
Platform, protocol, transport: different layers
| Layer | What it does | Examples |
|---|---|---|
| Platform (core) | The program that runs everything: accepts connections, applies routing rules, sends traffic out | V2Ray (v2fly-core), Xray-core |
| Proxy protocol | How client and server identify each other and describe the traffic | VMess, VLESS, Trojan, Shadowsocks, SOCKS, HTTP |
| Transport | Carries the protocol's bytes across the network | TCP, WebSocket, gRPC, mKCP, HTTPUpgrade, XHTTP |
| Security layer | Encrypts and authenticates the transport | TLS; REALITY in Xray |
A working configuration picks one of each, for example VLESS over WebSocket with TLS, running on Xray. Change the transport and the protocol stays the same. Change the platform and, as long as both ends support the protocol and transport, client and server still understand each other. Not every core supports every transport, though, as the table further down shows.
V2Ray (Project V)
V2Ray began as Project V, a set of tools for building your own proxy network. Its core combines several inbound and outbound protocols, a routing engine that can send different traffic different ways, and a choice of transports. VMess was its original protocol; VLESS was added later. Today the V2Ray codebase is maintained by the V2Fly community as v2fly-core, under the MIT license.
Xray (Project X)
Xray grew out of V2Ray. Its README states that "Xray-core v1.0.0 was forked from v2fly-core", and it has added a large number of enhancements since. The project, called Project X, "originates from XTLS protocol" and publishes Xray-core and REALITY. Xray-core is released under the Mozilla Public License 2.0.
Xray's main additions include:
- XTLS Vision, a VLESS flow that recognises TLS traffic inside the tunnel and avoids encrypting it a second time.
- REALITY, a TLS-based security layer that borrows the handshake of a real website, so a server doesn't need its own domain or certificate.
- XHTTP, a transport that carries traffic in ordinary HTTP requests.
- XUDP, which improves how UDP traffic is carried over proxy connections.
V2Ray vs Xray at a glance
| V2Ray (v2fly-core) | Xray-core | |
|---|---|---|
| Project | Project V, maintained by V2Fly | Project X (XTLS) |
| Origin | The original | Forked from v2fly-core |
| License | MIT | MPL 2.0 |
| VMess, Trojan, Shadowsocks, SOCKS, HTTP | Yes | Yes |
| VLESS | Yes | Yes, plus XTLS Vision flows |
| REALITY | No | Yes |
| XHTTP transport | No | Yes |
Because Xray started as a fork, a basic VMess or VLESS setup usually works with either core on the client side. Xray-only features such as REALITY, Vision and XHTTP need an Xray server and a client that supports them.
How Android apps use them
Most V2Ray and Xray apps on Android run the core inside the app and use Android's VPN interface to capture the phone's traffic. The app turns that traffic into connections, and the core sends them to the server with the configured protocol, transport and security. To you, it behaves like any other VPN: one switch, and a key icon in the status bar while it's on.
Where Socket Tunnel X fits
Socket Tunnel X, SBRK Dev Team's Android VPN, lists servers labelled VLESS-WS-TLS (VLESS over WebSocket and TLS) and V2RAY, alongside SSH and OpenVPN servers. You don't configure a core yourself: each server comes with its settings, and you choose by picking a server. Which VPN protocol should you use on Android? compares these options with SSH, OpenVPN and WireGuard.
FAQ
Is V2Ray a VPN?
Not in the strict sense: it's a proxy platform. Android apps make it behave like a VPN by routing the phone's traffic into it through Android's VPN interface.
Is Xray better than V2Ray?
Xray has features V2Ray doesn't, such as REALITY and XTLS Vision. Whether they matter depends on the server, because the client has to support what the server uses.
Can an Xray client connect to a V2Ray server?
Usually, for protocols both support, such as VMess, or VLESS without Xray-only extras. REALITY and Vision need Xray on the server.
What's the difference between VLESS and V2Ray?
VLESS is a protocol; V2Ray is a platform that can run it. See VLESS vs VMess for how VLESS works.
