How klzgrad/forwardproxy works
Main Components
a) Core Components:
• Caddy Web Server (as the host platform)
• Forward Proxy Module (main handler)
• Authentication System
• ACL (Access Control List) Manager
• Probe Resistance System
• PAC File Generator
• HTTP Client Handler
b) External Interfaces:
• Client Connections (HTTP/1.1 and HTTP/2)
• Upstream Proxy Connection (optional)
• Target Websites/Services
┌─ Client Layer ─────────────────────────┐
• Web Browsers │
• Operating Systems │
• Mobile Devices │
• ┬────────────────────┘
• ↓
┌─ Proxy Entry Layer ──────────────────────────────────┐
• ┌─ Probe Resistance Layer ─┐ │
• Secret Link Handler │ │
• Mimicry System │ │
• ┘ │
• ┌─ Authentication Layer ──┐ │
• Basic Auth Handler │ │
• ┘ │
• ┬────────────────────────────────┘
• ↓
┌─ Core Processing Layer ────────────────────────────┐
• ┌─ ACL Manager ─────┐ ┌─ Privacy Controls ──────┐ │
• IP Rules │ │ - IP Hiding │ │
• Domain Rules │ │ - Via Header Hiding │ │
• Subnet Rules │ └──────────────────────┘ │
• ┘ │
• ┌─ PAC File Server ─┐ ┌─ HTTP Client ────────┐ │
• Auto-Config │ │ - Connection Pool │ │
• Dynamic Gen │ │ - Timeout Handler │ │
• ┘ └──────────────────────┘ │
• ┬────────────────────────────┘
• ↓
┌─ Output Layer ──────────────────────────────────┐
• ┌─ Direct Connection ┐ ┌─ Upstream Proxy ────┐ │
• Target Websites │ │ - Optional Chain │ │
• ┘ └──────────────────────┘ │
• ┘
Important Flows to Highlight
a) Primary Request Flow:
• Client → Probe Resistance → Auth → ACL → HTTP Client → Target
b) PAC File Flow:
• Client → PAC Request → Dynamic Generation → Response
c) Upstream Proxy Flow:
• HTTP Client → Upstream Proxy → Target
Additional Elements
• Configuration endpoints
• Monitoring/logging points
• Security boundaries
Technical Details
• Supported protocols (HTTP/1.1, HTTP/2)
• Port specifications
• Authentication methods
• ACL rule types
• Timeout configurations
Remember to maintain a balance between detail and clarity, focusing on the key architectural components while providing enough technical detail to understand the system's operation.