# patterniha/mitm-domainfronting architecture

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

- Interactive diagram: https://gitdiagram.com/patterniha/mitm-domainfronting
- Repository: https://github.com/patterniha/mitm-domainfronting

## Overview

This repository provides an Xray domain-fronting configuration and setup instructions, rather than implementing a proxy engine. The documented workflow is to generate a personal certificate, trust it on the device or browser, load the JSON configuration into v2rayN or v2rayNG with Xray as its core, and use a browser through the configured proxy or Android TUN. Xray performs the documented MITM/domain-fronting behavior toward supported services. Relationships shown here come from the README; the configuration and batch script contents were not available as source excerpts.

Main entry points: [`Xray-config/certificate_generator.bat`](https://github.com/patterniha/mitm-domainfronting/blob/main/Xray-config/certificate_generator.bat) (Certificate generator), [`Xray-config/MITM-DomainFronting.json`](https://github.com/patterniha/mitm-domainfronting/blob/main/Xray-config/MITM-DomainFronting.json) (Xray configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_browser(("Browser"))
node_certificate_script["Certificate generator"]
node_certificates["Personal certificate"]
node_trust_store[("Trusted root store")]
node_client_apps["v2rayN / v2rayNG"]
node_configuration["Xray configuration"]
node_xray["Xray core"]
node_services(("Supported services"))

node_certificate_script -->|"generates"| node_certificates
node_certificates -->|"install as trusted root"| node_trust_store
node_configuration -->|"import into"| node_client_apps
node_client_apps -->|"runs with"| node_xray
node_browser -->|"sends traffic via"| node_client_apps
node_xray -->|"forwards with fake SNI"| node_services
node_trust_store -->|"enables certificate trust"| node_browser

click node_certificate_script "https://github.com/patterniha/mitm-domainfronting/blob/main/Xray-config/certificate_generator.bat"
click node_configuration "https://github.com/patterniha/mitm-domainfronting/blob/main/Xray-config/MITM-DomainFronting.json"

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_browser toneBlue
class node_certificate_script,node_configuration toneTeal
class node_certificates,node_client_apps,node_xray,node_services toneIndigo
class node_trust_store toneAmber
```

## Components

### Other components

- **Browser**
- [Certificate generator](https://github.com/patterniha/mitm-domainfronting/blob/main/Xray-config/certificate_generator.bat): `Xray-config/certificate_generator.bat`
- **Personal certificate**
- **Trusted root store**
- **v2rayN / v2rayNG**
- [Xray configuration](https://github.com/patterniha/mitm-domainfronting/blob/main/Xray-config/MITM-DomainFronting.json): `Xray-config/MITM-DomainFronting.json`
- **Xray core**
- **Supported services**

## Connections

- Certificate generator → Personal certificate: generates (evidence: `README.md`)
- Personal certificate → Trusted root store: install as trusted root (evidence: `README.md`)
- Xray configuration → v2rayN / v2rayNG: import into (evidence: `README.md`)
- v2rayN / v2rayNG → Xray core: runs with (evidence: `README.md`)
- Browser → v2rayN / v2rayNG: sends traffic via (evidence: `README.md`)
- Xray core → Supported services: forwards with fake SNI (evidence: `README.md`)
- Trusted root store → Browser: enables certificate trust (evidence: `README.md`)
