# creazyboyone/fastgithub architecture

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

- Interactive diagram: https://gitdiagram.com/creazyboyone/fastgithub
- Repository: https://github.com/creazyboyone/fastgithub

## Overview

FastGithub is a local GitHub-acceleration proxy, not a VPN. Users direct HTTP/HTTPS traffic to its local proxy; proxy handlers apply domain-specific behavior and resolve destinations before forwarding. Its documented capabilities also include clean DNS answers, IP speed testing, custom TLS settings, and Google CDN resource replacement. The graph preserves DNS interception, TCP proxying, certificate management, and the desktop launcher. Some runtime wiring and several feature implementations were not excerpted, so uncertain relationships are omitted.

Main entry points: [`FastGithub.Http/HttpClientHandler.cs`](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.Http/HttpClientHandler.cs) (HTTP transport), [`FastGithub.Configuration/FastGithubConfig.cs`](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.Configuration/FastGithubConfig.cs) (Config matcher), [`FastGithub.DomainResolve/IDomainResolver.cs`](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.DomainResolve/IDomainResolver.cs) (Domain resolver), [`FastGithub.HttpServer/Certs/CertService.cs`](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.HttpServer/Certs/CertService.cs) (Certificate service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime and UI"]
  node_desktop["Desktop launcher<br/>[Program.cs]"]
  node_app["Application host"]
end

subgraph group_config["Configuration"]
  node_options["Runtime options"]
  node_domainconfig["Domain rules<br/>[DomainConfig.cs]"]
  node_fastconfig["Config matcher"]
end

subgraph group_resolve["Domain resolution"]
  node_dnsclient["DNS lookup and speed<br/>[DnsClient.cs]"]
  node_resolver["Domain resolver<br/>[IDomainResolver.cs]"]
  node_domainservice["Resolver service"]
end

subgraph group_proxy["Proxy handling"]
  node_httpclient["Forwarding client<br/>[HttpClient.cs]"]
  node_httptransport["HTTP transport"]
  node_factory["Client factory"]
  node_httpproxy["HTTP reverse proxy"]
  node_tcpforward["TCP reverse proxy"]
end

subgraph group_cert["Certificates"]
  node_certservice["Certificate service<br/>[CertService.cs]"]
  node_certgenerator["Certificate generator<br/>[CertGenerator.cs]"]
  node_certinstaller["CA installers"]
end

subgraph group_intercept["Packet interception"]
  node_dnsintercept["DNS interceptor<br/>[DnsInterceptor.cs]"]
  node_dnshosted["DNS intercept service"]
  node_conflicts["DNS conflict solvers"]
  node_tcphosted["TCP intercept service"]
  node_tcpinterceptors["TCP interceptors<br/>[ITcpInterceptor.cs]"]
end

node_user(("Proxy user"))

node_user -->|"sends proxy traffic"| node_httpproxy
node_desktop -->|"starts process"| node_app
node_app -->|"reads options"| node_options
node_options -->|"configures"| node_fastconfig
node_fastconfig -->|"matches domains"| node_domainconfig
node_httpproxy -->|"requests client"| node_factory
node_factory -->|"creates client"| node_httpclient
node_httpclient -->|"sends request"| node_httptransport
node_httptransport -->|"resolves endpoint"| node_resolver
node_httptransport -->|"applies TLS rules"| node_domainconfig
node_tcpforward -->|"resolves endpoint"| node_resolver
node_resolver -.->|"resolves and tests"| node_dnsclient
node_dnsintercept -->|"uses configuration"| node_fastconfig
node_dnshosted -->|"runs interception"| node_dnsintercept
node_dnshosted -->|"solves conflicts"| node_conflicts
node_tcphosted -->|"runs interceptors"| node_tcpinterceptors
node_certservice -->|"creates certificates"| node_certgenerator
node_certservice -.->|"installs CA"| node_certinstaller

click node_desktop "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.UI/Program.cs"
click node_app "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub/AppHostedService.cs"
click node_options "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.Configuration/FastGithubOptions.cs"
click node_domainconfig "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.Configuration/DomainConfig.cs"
click node_fastconfig "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.Configuration/FastGithubConfig.cs"
click node_dnsclient "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.DomainResolve/DnsClient.cs"
click node_resolver "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.DomainResolve/IDomainResolver.cs"
click node_domainservice "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.DomainResolve/DomainResolveHostedService.cs"
click node_httpclient "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.Http/HttpClient.cs"
click node_httptransport "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.Http/HttpClientHandler.cs"
click node_factory "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.Http/HttpClientFactory.cs"
click node_httpproxy "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.HttpServer/HttpMiddlewares/HttpReverseProxyMiddleware.cs"
click node_tcpforward "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.HttpServer/TcpMiddlewares/TcpReverseProxyHandler.cs"
click node_certservice "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.HttpServer/Certs/CertService.cs"
click node_certgenerator "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.HttpServer/Certs/CertGenerator.cs"
click node_certinstaller "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.HttpServer/Certs/ICaCertInstaller.cs"
click node_dnsintercept "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.PacketIntercept/Dns/DnsInterceptor.cs"
click node_dnshosted "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.PacketIntercept/DnsInterceptHostedService.cs"
click node_conflicts "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.PacketIntercept/IDnsConflictSolver.cs"
click node_tcphosted "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.PacketIntercept/TcpInterceptHostedService.cs"
click node_tcpinterceptors "https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.PacketIntercept/ITcpInterceptor.cs"

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_desktop,node_app,node_user toneBlue
class node_options,node_domainconfig,node_fastconfig toneAmber
class node_dnsclient,node_resolver,node_domainservice toneMint
class node_httpclient,node_httptransport,node_factory,node_httpproxy,node_tcpforward toneRose
class node_certservice,node_certgenerator,node_certinstaller toneIndigo
class node_dnsintercept,node_dnshosted,node_conflicts,node_tcphosted,node_tcpinterceptors toneTeal
```

## Components

### Runtime and UI

- [Desktop launcher](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.UI/Program.cs): `FastGithub.UI/Program.cs`
- [Application host](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub/AppHostedService.cs): `FastGithub/AppHostedService.cs`

### Configuration

- [Runtime options](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.Configuration/FastGithubOptions.cs): `FastGithub.Configuration/FastGithubOptions.cs`
- [Domain rules](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.Configuration/DomainConfig.cs): `FastGithub.Configuration/DomainConfig.cs`
- [Config matcher](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.Configuration/FastGithubConfig.cs): `FastGithub.Configuration/FastGithubConfig.cs`

### Domain resolution

- [DNS lookup and speed](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.DomainResolve/DnsClient.cs): `FastGithub.DomainResolve/DnsClient.cs`
- [Domain resolver](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.DomainResolve/IDomainResolver.cs): `FastGithub.DomainResolve/IDomainResolver.cs`
- [Resolver service](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.DomainResolve/DomainResolveHostedService.cs): `FastGithub.DomainResolve/DomainResolveHostedService.cs`

### Proxy handling

- [Forwarding client](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.Http/HttpClient.cs): `FastGithub.Http/HttpClient.cs`
- [HTTP transport](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.Http/HttpClientHandler.cs): `FastGithub.Http/HttpClientHandler.cs`
- [Client factory](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.Http/HttpClientFactory.cs): `FastGithub.Http/HttpClientFactory.cs`
- [HTTP reverse proxy](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.HttpServer/HttpMiddlewares/HttpReverseProxyMiddleware.cs): `FastGithub.HttpServer/HttpMiddlewares/HttpReverseProxyMiddleware.cs`
- [TCP reverse proxy](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.HttpServer/TcpMiddlewares/TcpReverseProxyHandler.cs): `FastGithub.HttpServer/TcpMiddlewares/TcpReverseProxyHandler.cs`

### Certificates

- [Certificate service](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.HttpServer/Certs/CertService.cs): `FastGithub.HttpServer/Certs/CertService.cs`
- [Certificate generator](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.HttpServer/Certs/CertGenerator.cs): `FastGithub.HttpServer/Certs/CertGenerator.cs`
- [CA installers](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.HttpServer/Certs/ICaCertInstaller.cs): `FastGithub.HttpServer/Certs/ICaCertInstaller.cs`

### Packet interception

- [DNS interceptor](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.PacketIntercept/Dns/DnsInterceptor.cs): `FastGithub.PacketIntercept/Dns/DnsInterceptor.cs`
- [DNS intercept service](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.PacketIntercept/DnsInterceptHostedService.cs): `FastGithub.PacketIntercept/DnsInterceptHostedService.cs`
- [DNS conflict solvers](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.PacketIntercept/IDnsConflictSolver.cs): `FastGithub.PacketIntercept/IDnsConflictSolver.cs`
- [TCP intercept service](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.PacketIntercept/TcpInterceptHostedService.cs): `FastGithub.PacketIntercept/TcpInterceptHostedService.cs`
- [TCP interceptors](https://github.com/creazyboyone/fastgithub/blob/master/FastGithub.PacketIntercept/ITcpInterceptor.cs): `FastGithub.PacketIntercept/ITcpInterceptor.cs`

### Other components

- **Proxy user**

## Connections

- Proxy user → HTTP reverse proxy: sends proxy traffic
- Desktop launcher → Application host: starts process (evidence: `FastGithub.UI/Program.cs`)
- Application host → Runtime options: reads options (evidence: `FastGithub/AppHostedService.cs`)
- Runtime options → Config matcher: configures (evidence: `FastGithub.Configuration/FastGithubConfig.cs`)
- Config matcher → Domain rules: matches domains (evidence: `FastGithub.Configuration/FastGithubConfig.cs`)
- HTTP reverse proxy → Client factory: requests client (evidence: `FastGithub.HttpServer/HttpMiddlewares/HttpReverseProxyMiddleware.cs`)
- Client factory → Forwarding client: creates client (evidence: `FastGithub.Http/HttpClientFactory.cs`)
- Forwarding client → HTTP transport: sends request (evidence: `FastGithub.Http/HttpClient.cs`)
- HTTP transport → Domain resolver: resolves endpoint (evidence: `FastGithub.Http/HttpClientHandler.cs`)
- HTTP transport → Domain rules: applies TLS rules (evidence: `FastGithub.Http/HttpClientHandler.cs`)
- TCP reverse proxy → Domain resolver: resolves endpoint (evidence: `FastGithub.HttpServer/TcpMiddlewares/TcpReverseProxyHandler.cs`)
- Domain resolver → DNS lookup and speed: resolves and tests
- DNS interceptor → Config matcher: uses configuration (evidence: `FastGithub.PacketIntercept/Dns/DnsInterceptor.cs`)
- DNS intercept service → DNS interceptor: runs interception (evidence: `FastGithub.PacketIntercept/DnsInterceptHostedService.cs`)
- DNS intercept service → DNS conflict solvers: solves conflicts (evidence: `FastGithub.PacketIntercept/DnsInterceptHostedService.cs`)
- TCP intercept service → TCP interceptors: runs interceptors (evidence: `FastGithub.PacketIntercept/TcpInterceptHostedService.cs`)
- Certificate service → Certificate generator: creates certificates (evidence: `FastGithub.HttpServer/Certs/CertService.cs`)
- Certificate service → CA installers: installs CA (evidence: `FastGithub.HttpServer/Certs/CertService.cs`)
