-
Notifications
You must be signed in to change notification settings - Fork 111
Description
At the next Tor anti-censorship team reading group (Thursday June 11 at 16:00 UTC), we are going to be discussing V2Ray. The members of the team are not very familiar with V2Ray, and we want to broaden our understanding.
Here are some of my preliminary notes on V2Ray. I hope that some readers who are more familiar with V2Ray will be able to correct my misunderstandings and provide more detail. For example, I'm unsure about the relationship between V2Ray and VMess—they seem to have some historical relationship, but I'm not sure.
V2Ray itself is not a protocol or circumvention system by itself. Rather, V2Ray is a platform or framework that allows you to run one or more proxies, with various layered proxy protocols, transports, and obfuscation. For example, you could run SOCKS-in-TLS on one port, and VMess-in-QUIC (with the QUIC packets optionally obfuscated) on another port. On the client side, you can configure routing to control what traffic should use what proxy, or should not be proxied at all.
At the lowest level, V2Ray supports a variety of proxy protocols, some inherently obfuscated and some not:
- A standard HTTP proxy (GET/CONNECT).
- Plain SOCKS (SOCKS 4, SOCKS 4a, or SOCKS 5).
- MTProto, as used by Telegram) and only capable of proxying to Telegram servers.
- Shadowsocks, using the recommended AEAD ciphers, or, unfortunately, the deprecated stream ciphers and one time auth.
- VMess, a custom authenticated and encrypted proxy protocol. There's a technical protocol specification.
There's an optional mux (multiplex) layer to tunnel multiple streams through one proxy connection.
The proxy protocols are not inherently implemented over any particular kind of network connection. Instead, you must specify a transport for each:
- A TCP connection.
- mKCP, a reliable channel implemented using UDP packets. I am not sure how mKCP differs from KCP, if at all. Readers of this BBS will recall KCP from previous discussions about an inner session layer for Turbo Tunnel (Turbo Tunnel: let's include a sequencing/reliability layer in our circumvention protocols #9, Turbo Tunnel candidate protocol evaluation #14).
- A WebSocket connection over TCP.
- HTTP/2.
- A QUIC connection.
Any of the transport layers may optionally have a layer of TLS applied to them. The TLS option is obligatory with the HTTP/2 and QUIC transports.
Finally, at the highest level, some transports support additional, optional obfuscation options:
- TCP connections may be prefixed by phony HTTP headers.
- mKCP and QUIC may have their UDP packets transformed to resemble SRTP, uTP, Wechat video, DTLS, or Wireguard packets.
The V2Ray model provides a lot of flexibility. You could set up an unauthenticated SOCKS proxy without any encryption, or you could set up VMess open only to authorized users, tunneled through WebSocket with TLS.