How mike10004/har-replay works
Main Components
a. Core Components:
• HAR File Storage
• Proxy Server
• Replay Manager
• Request Matcher
• Response Encoder
• Configuration Manager
b. Integration Components:
• Browser Interface
• HTTP Client Interface
• Certificate Management System
• Variable Dictionary
Component Relationships
[Client (Browser/HTTP Client)] → [Proxy Server]
• ↓
• [Replay Manager]
• ↓
• [Request Matcher/Parser] ← [HAR File]
• ↓
• [Response Encoder] → [Response Interceptor]
• ↓
• [Client]
Architectural Patterns to Highlight
• Bridge Pattern (evident from the harbridge package)
• Factory Pattern (seen in various factory classes)
• Interceptor Pattern (for response manipulation)
• State Pattern (for session management)
Specific Implementation Details
a. Core Modules (from project structure):
• har-replay-core: Core functionality
• har-replay-vhs: VHS implementation
• virtual-har-server: Server implementation
• har-replay-exec: Execution module
b. Key Features:
• TLS/SSL support (shown by certificate management)
• Multiple browser support
• Content encoding handling
• Variable substitution
Technical Stack Elements
• Java-based implementation
• BrowserMob Proxy integration
• Selenium WebDriver support
• Maven build system
┌─ Client Layer ─────────────────────┐
• Web Browsers │
• HTTP Clients │
• Selenium WebDriver │
• ┬───────────────────┘
• ↓
┌─ Proxy Layer ─────────────────────┐
• HTTP/HTTPS Proxy │
• Certificate Management │
• Request Interception │
• ┬───────────────────┘
• ↓
┌─ Core Layer ──────────────────────┐
• Replay Manager │
• Request Matcher │
• Response Encoder │
• Variable Dictionary │
• ┬───────────────────┘
• ↓
┌─ Storage Layer ────────────────────┐
• HAR File Processing │
• Response Cache │
• Configuration Store │
• ┘
Additional Notes
• Version information (current: 0.26)
• Supported protocols (HTTP/HTTPS)
• Temporary storage locations
• Entry points (CLI and Library interfaces)