V2Ray, Clash & Clash Meta Protocol Support and Configuration Guide
Introduction
This document introduces and compares the proxy protocols used by V2Ray, Clash, and Clash Meta. It provides standard configuration examples for different protocols to show their differences and help users set them up correctly.
I. Platform and Protocol Support Comparison
V2Ray, Clash, and Clash Meta support different protocols. V2Ray provides the basic protocol support. Clash focuses on rules and user-friendliness. Clash Meta is an extension of Clash that supports newer, high-performance protocols.
Protocol Support Matrix
Protocol | V2Ray | Clash | Clash Meta |
---|---|---|---|
VMess | ✅ | ✅ | ✅ |
VLESS | ✅ | ❌ | ✅ |
Trojan | ✅ | ✅ | ✅ |
Shadowsocks (SS) | ✅ | ✅ | ✅ |
ShadowsocksR (SSR) | ❌ | ✅ | ✅ |
SOCKS / SOCKS5 | ✅ | ✅ | ✅ |
HTTP(S) | ✅ | ✅ | ✅ |
Snell | ❌ | ✅ | ✅ |
MTProto | ✅ | ❌ | ❌ |
Hysteria / Hysteria2 | ❌ | ❌ | ✅ |
TUIC | ❌ | ❌ | ✅ |
Core Differences Summary
- V2Ray is a core V2Fly project that supports many protocols and is highly customizable, especially for VMess and VLESS. Its configuration is very flexible because it includes several inbound and outbound protocols.
- Clash is known for its powerful rule system and its use of a single YAML file for configuration. It combines many common protocols, but its original core is no longer updated, meaning it does not support newer protocols like VLESS.
- Clash Meta, now called mihomo, is an active and updated version of the original Clash. It is fully compatible with Clash's features while also adding support for new protocols such as VLESS, Hysteria2, and TUIC, making it the most complete version currently available.
II. Protocol Configuration Examples
Below are standard configuration snippets for each protocol on different platforms. Please note that all placeholders like server.com
, your-uuid
, your-password
, etc., in the examples need to be replaced with your own node information.
1. Shadowsocks (SS)
Features: Classic, lightweight, and efficient.
Clash / Clash Meta (YAML)
yaml- name: "SS-Server" type: ss server: server.com port: 8388 cipher: aes-256-gcm password: "your-password" udp: true
V2Ray (JSON)
json { "protocol": "shadowsocks", "settings": { "servers": [ { "address": "server.com", "port": 8388, "method": "aes-256-gcm", "password": "your-password" } ] } }
2. Trojan
Features: Mimics HTTPS traffic, providing good obfuscation.
Clash / Clash Meta (YAML)
yaml- name: "Trojan-Server" type: trojan server: server.com port: 443 password: "your-password" sni: "your-domain.com" udp: true
V2Ray (JSON)
json { "protocol": "trojan", "settings": { "servers": [ { "address": "server.com", "port": 443, "password": "your-password" } ] }, "streamSettings": { "security": "tls", "tlsSettings": { "serverName": "your-domain.com" } } }
3. VMess
Features: V2Ray's core protocol, powerful with many configurable options.
Clash / Clash Meta (YAML)
yaml- name: "VMess-Server" type: vmess server: server.com port: 10086 uuid: "your-uuid" alterId: 0 cipher: auto network: "ws" tls: true servername: "your-domain.com" ws-opts: path: "/your-path" headers: Host: your-domain.com
V2Ray (JSON)
json { "protocol": "vmess", "settings": { "vnext": [ { "address": "server.com", "port": 10086, "users": [ { "id": "your-uuid", "alterId": 0, "security": "auto" } ] } ] }, "streamSettings": { "network": "ws", "security": "tls", "tlsSettings": { "serverName": "your-domain.com" }, "wsSettings": { "path": "/your-path", "headers": { "Host": "your-domain.com" } } } }
4. SOCKS5
Features: A general-purpose network transport protocol that can be used for proxy chaining.
Clash / Clash Meta (YAML)
yaml- name: "SOCKS5-Upstream" type: socks5 server: proxy.server.com port: 1080 # username: "user" # optional # password: "password" # optional # udp: true # optional
V2Ray (JSON)
json { "protocol": "socks", "settings": { "servers": [ { "address": "proxy.server.com", "port": 1080, "users": [ { "user": "user", "pass": "password" } ] } ] } }
5. HTTP(S)
Features: A general-purpose HTTP proxy that supports TLS encryption.
Clash / Clash Meta (YAML)
yaml- name: "HTTP-Upstream" type: http server: proxy.server.com port: 8080 # username: "user" # optional # password: "password" # optional # tls: true # if it is an HTTPS proxy
V2Ray (JSON)
json { "protocol": "http", "settings": { "servers": [ { "address": "proxy.server.com", "port": 8080, "users": [ { "user": "user", "pass": "password" } ] } ] } }
6. VLESS
Features: The lightweight successor to VMess, offering better performance, often used with XTLS.
Clash Meta (YAML)
yaml- name: "VLESS-Server" type: vless server: server.com port: 443 uuid: "your-uuid" network: "ws" tls: true servername: "your-domain.com" client-fingerprint: "chrome" ws-opts: path: "/your-path"
V2Ray (JSON)
json { "protocol": "vless", "settings": { "vnext": [ { "address": "server.com", "port": 443, "users": [ { "id": "your-uuid", "flow": "xtls-rprx-vision", "encryption": "none" } ] } ] }, "streamSettings": { "security": "xtls", "xtlsSettings": { "serverName": "your-domain.com" } } }
7. ShadowsocksR (SSR)
- Features: An early fork of SS that added protocol obfuscation features.
- Clash / Clash Meta (YAML)
```yaml
- name: "SSR-Server" type: ssr server: server.com port: 12345 cipher: aes-256-cfb password: "your-password" protocol: "authaes128md5" protocol-param: "1234:abcd" obfs: "tls1.2ticketauth" obfs-param: "your-domain.com" ```
8. Snell
- Features: A lightweight protocol developed by Surge.
- Clash / Clash Meta (YAML)
```yaml
- name: "Snell-Server" type: snell server: server.com port: 23456 psk: "your-pre-shared-key" obfs-opts: mode: tls host: www.bing.com ```
9. MTProto
- Features: Telegram's proprietary protocol; V2Ray can be used to proxy Telegram traffic.
- V2Ray (JSON)
json { "protocol": "mtproto", "settings": { "servers": [ { "address": "proxy.server.com", "port": 443, "users": [ { "secret": "dd000102030405060708090a0b0c0d0e0f" } ] } ] } }
10. Hysteria2
- Features: Based on QUIC, performs excellently on unstable networks with strong resistance to packet loss.
- Clash Meta (YAML)
```yaml
- name: "Hysteria2-Server" type: hysteria2 server: server.com port: 34567 auth: "your-password" sni: your-domain.com ```
11. TUIC
- Features: Also based on QUIC, designed to maximize throughput and reduce latency.
- Clash Meta (YAML)
```yaml
- name: "TUIC-Server" type: tuic server: server.com port: 45678 uuid: "your-uuid" password: "your-password" sni: your-domain.com udp-relay-mode: "native" congestion-controller: "bbr"