How robbie-cahill/tunnelmole-service works
Main Components
a) Client-Side Components:
• Tunnelmole Client (external component that connects to the service)
• Local Web Application (the user's application being tunneled)
b) Service-Side Components:
• WebSocket Server (src/websocket/host-ip-websocket.ts)
• HTTP Proxy Server (src/proxy.ts)
• Authentication System (src/authentication/)
• Domain Management System (src/reserved-domain/)
• Database Layer (src/mysql/)
• Telemetry System (src/telemetry/)
[Client Layer]
[Communication Layer]
[Service Layer]
[Persistence Layer]
Key Elements to Highlight
a) Connection Flow:
• WebSocket connection establishment
• HTTP/HTTPS request routing
• Domain reservation process
• Authentication checkpoints
b) Data Flow:
• Client initialization messages
• Request forwarding
• Response handling
• Telemetry logging
Specific Implementation Details
[Local Web App] ←→ [Tunnelmole Client]
• ↓
[WebSocket Connection]
• ↓
[Tunnelmole Service]
• Domain Manager
• Request Handler
• Authentication
• Database
Important Architectural Patterns to Highlight
• WebSocket-based persistent connections
• Message-based communication (src/messages/)
• Repository pattern (src/repository/)
• Handler pattern (src/handlers/)
Technical Details
• Port configurations (80/443 for HTTP/HTTPS, 81 for WebSocket)
• Database connections
• Security checkpoints
• Domain reservation system
Implementation Notes
• The TypeScript/Node.js runtime environment
• Functional programming patterns used
• Hot reload capability for development
• Security boundaries and checkpoints
Remember to include the monitoring endpoint (/tunnelmole-connections) and show how it interfaces with the main system.
• Clear component hierarchy
• Different line styles for different types of connections
• Proper grouping of related components
• Detailed annotations where needed