# xtls/xray-examples architecture

> Architecture diagram of the GitHub repository xtls/xray-examples, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xtls/xray-examples
- Repository: https://github.com/xtls/xray-examples

## Overview

Xray-examples is a catalog of Xray-core configuration examples, not a single running application. Its principal user task is to find a client/server configuration variant for a protocol and transport; the tree also shows reverse-proxy, serverless, and Nginx fallback examples. No source excerpts were provided, and the top-level README gives only the general relationship to Xray-core. Accordingly, the graph groups the configuration families but does not infer runtime calls or client-to-server flows from matching filenames.

Main entry points: [`VLESS-TCP`](https://github.com/xtls/xray-examples/tree/main/VLESS-TCP) (VLESS examples)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core protocol examples"]
  node_vless["VLESS examples"]
  node_vmess["VMess examples"]
  node_shadowsocks["Shadowsocks examples"]
  node_trojan["Trojan examples"]
  node_socks["SOCKS5 examples"]
end

subgraph group_transport["Transport variants"]
  node_grpc["gRPC variants"]
  node_httpcaddy["HTTP Caddy variants"]
  node_splithttp["SplitHTTP variants"]
  node_xhttp["XHTTP variants"]
  node_vision["Vision variants"]
  node_reality["REALITY variants"]
  node_vlessws["VLESS WebSocket"]
  node_vmesswebsocket["VMess WebSocket"]
  node_vmesshttp["VMess HTTP variants"]
end

subgraph group_deployment["Deployment patterns"]
  node_reverse["Reverse proxy setups"]
  node_serverless["Serverless setups"]
  node_domainfront["Domain fronting"]
  node_fallbacks["Nginx fallbacks"]
  node_hysteria["Hysteria2 setup"]
end

subgraph group_catalog["Configuration catalog"]
  node_clientconfigs["Client config collection<br/>[client.configs]"]
end

node_user(("Configuration user"))
node_xray["Xray-core"]

node_user -.->|"selects example"| node_vless
node_vless -->|"example for"| node_xray

click node_vless "https://github.com/xtls/xray-examples/tree/main/VLESS-TCP"
click node_vmess "https://github.com/xtls/xray-examples/tree/main/VMess-TCP"
click node_shadowsocks "https://github.com/xtls/xray-examples/tree/main/Shadowsocks-TCP"
click node_trojan "https://github.com/xtls/xray-examples/tree/main/Trojan-TCP-TLS%20(minimal)"
click node_socks "https://github.com/xtls/xray-examples/tree/main/Socks5-TLS"
click node_grpc "https://github.com/xtls/xray-examples/tree/main/VLESS-GRPC"
click node_httpcaddy "https://github.com/xtls/xray-examples/tree/main/VLESS-HTTP-Caddy"
click node_splithttp "https://github.com/xtls/xray-examples/tree/main/VLESS-TLS-SplitHTTP-CaddyNginx"
click node_xhttp "https://github.com/xtls/xray-examples/tree/main/VLESS-XHTTP-Reality"
click node_vision "https://github.com/xtls/xray-examples/tree/main/VLESS-TCP-XTLS-Vision"
click node_reality "https://github.com/xtls/xray-examples/tree/main/VLESS-TCP-REALITY%20(without%20being%20stolen)"
click node_reverse "https://github.com/xtls/xray-examples/tree/main/ReverseProxy"
click node_serverless "https://github.com/xtls/xray-examples/tree/main/Serverless-for-Iran"
click node_domainfront "https://github.com/xtls/xray-examples/tree/main/MITM-Domain-Fronting"
click node_fallbacks "https://github.com/xtls/xray-examples/tree/main/All-in-One-fallbacks-Nginx"
click node_hysteria "https://github.com/xtls/xray-examples/tree/main/Hysteria2"
click node_clientconfigs "https://github.com/xtls/xray-examples/tree/main/All-in-One-fallbacks-Nginx/client.configs"
click node_vlessws "https://github.com/xtls/xray-examples/tree/main/VLESS-TCP-TLS-WS"
click node_vmesswebsocket "https://github.com/xtls/xray-examples/tree/main/VMess-Websocket"
click node_vmesshttp "https://github.com/xtls/xray-examples/tree/main/VMess-HTTP"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_vless,node_vmess,node_shadowsocks,node_trojan,node_socks,node_user toneBlue
class node_grpc,node_httpcaddy,node_splithttp,node_xhttp,node_vision,node_reality,node_vlessws,node_vmesswebsocket,node_vmesshttp toneAmber
class node_reverse,node_serverless,node_domainfront,node_fallbacks,node_hysteria toneMint
class node_clientconfigs toneRose
class node_xray toneIndigo
```

## Components

### Core protocol examples

- [VLESS examples](https://github.com/xtls/xray-examples/tree/main/VLESS-TCP): `VLESS-TCP`
- [VMess examples](https://github.com/xtls/xray-examples/tree/main/VMess-TCP): `VMess-TCP`
- [Shadowsocks examples](https://github.com/xtls/xray-examples/tree/main/Shadowsocks-TCP): `Shadowsocks-TCP`
- [Trojan examples](https://github.com/xtls/xray-examples/tree/main/Trojan-TCP-TLS%20(minimal)): `Trojan-TCP-TLS (minimal)`
- [SOCKS5 examples](https://github.com/xtls/xray-examples/tree/main/Socks5-TLS): `Socks5-TLS`

### Transport variants

- [gRPC variants](https://github.com/xtls/xray-examples/tree/main/VLESS-GRPC): `VLESS-GRPC`
- [HTTP Caddy variants](https://github.com/xtls/xray-examples/tree/main/VLESS-HTTP-Caddy): `VLESS-HTTP-Caddy`
- [SplitHTTP variants](https://github.com/xtls/xray-examples/tree/main/VLESS-TLS-SplitHTTP-CaddyNginx): `VLESS-TLS-SplitHTTP-CaddyNginx`
- [XHTTP variants](https://github.com/xtls/xray-examples/tree/main/VLESS-XHTTP-Reality): `VLESS-XHTTP-Reality`
- [Vision variants](https://github.com/xtls/xray-examples/tree/main/VLESS-TCP-XTLS-Vision): `VLESS-TCP-XTLS-Vision`
- [REALITY variants](https://github.com/xtls/xray-examples/tree/main/VLESS-TCP-REALITY%20(without%20being%20stolen)): `VLESS-TCP-REALITY (without being stolen)`
- [VLESS WebSocket](https://github.com/xtls/xray-examples/tree/main/VLESS-TCP-TLS-WS): `VLESS-TCP-TLS-WS`
- [VMess WebSocket](https://github.com/xtls/xray-examples/tree/main/VMess-Websocket): `VMess-Websocket`
- [VMess HTTP variants](https://github.com/xtls/xray-examples/tree/main/VMess-HTTP): `VMess-HTTP`

### Deployment patterns

- [Reverse proxy setups](https://github.com/xtls/xray-examples/tree/main/ReverseProxy): `ReverseProxy`
- [Serverless setups](https://github.com/xtls/xray-examples/tree/main/Serverless-for-Iran): `Serverless-for-Iran`
- [Domain fronting](https://github.com/xtls/xray-examples/tree/main/MITM-Domain-Fronting): `MITM-Domain-Fronting`
- [Nginx fallbacks](https://github.com/xtls/xray-examples/tree/main/All-in-One-fallbacks-Nginx): `All-in-One-fallbacks-Nginx`
- [Hysteria2 setup](https://github.com/xtls/xray-examples/tree/main/Hysteria2): `Hysteria2`

### Configuration catalog

- [Client config collection](https://github.com/xtls/xray-examples/tree/main/All-in-One-fallbacks-Nginx/client.configs): `All-in-One-fallbacks-Nginx/client.configs`

### Other components

- **Configuration user**
- **Xray-core**

## Connections

- Configuration user → VLESS examples: selects example
- VLESS examples → Xray-core: example for (evidence: `README.md`)
