How yusing/go-proxy works
Main Components Identification
The system should be divided into these major components:
a) Core Proxy Engine
• Reverse Proxy Handler
• TCP/UDP Forwarders
• SSL/TLS Manager (Autocert)
• Docker Integration
• Configuration Manager
b) Web Interface
• API Layer
• Authentication System
• Dashboard UI
• Configuration Editor
Key Architectural Elements
a) Modular Architecture:
• Internal packages are well-separated (/internal directory)
• Clear separation of concerns (api, config, docker, metrics, etc.)
• Middleware-based request processing
b) Event-Driven System:
• Watchers for configuration changes
• Docker container state monitoring
• Health checking system
┌─────────────────────────────────────────────────────────────┐
• Client Requests │
• ┘
• ↓
┌─────────────────────────────────────────────────────────────┐
• Entry Points Layer │
• ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
• HTTP/HTTPS │ │ TCP │ │ UDP │ │
• ┘ └─────────────┘ └─────────────┘ │
• ┘
• ↓
┌─────────────────────────────────────────────────────────────┐
• Core Proxy Layer │
• ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
• Middleware │ │ Routing │ │ Load Balance │ │
• ┘ └─────────────┘ └─────────────┘ │
• ┘
• ↓
┌─────────────────────────────────────────────────────────────┐
• Service Layer │
• ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
• Docker │ │ AutoCert │ │ Metrics │ │
• ┘ └─────────────┘ └─────────────┘ │
• ┘
Component Interactions
• Client request flow through the system
• Configuration updates and hot-reload paths
• Docker container management flow
• Metrics collection paths
• SSL certificate management flow
Special Features Highlight
• IdleSleeper functionality
• Auto SSL certification management
• Docker auto-configuration
• Health monitoring system
Additional Elements
Supporting components:
• Configuration stores
• Certificate storage
• Metrics endpoints
• WebUI components
• Authentication flow