start fixing tests
This commit is contained in:
@@ -70,14 +70,14 @@ interface IRouteAction {
|
||||
#### IMPORTANT: Phase 1 Must Be Completed First
|
||||
The `ProxyProtocolSocket` (WrappedSocket) is the foundation for all PROXY protocol functionality. This wrapper class must be implemented and integrated BEFORE any PROXY protocol parsing can begin.
|
||||
|
||||
#### Phase 1: ProxyProtocolSocket (WrappedSocket) Foundation - ✅ COMPLETED
|
||||
#### Phase 1: ProxyProtocolSocket (WrappedSocket) Foundation - ✅ COMPLETED (v19.5.19)
|
||||
This phase creates the socket wrapper infrastructure that all subsequent phases depend on.
|
||||
|
||||
1. **Create WrappedSocket class** in `ts/core/models/wrapped-socket.ts` ✅
|
||||
- Basic socket wrapper that extends EventEmitter
|
||||
- Used JavaScript Proxy pattern instead of EventEmitter (avoids infinite loops)
|
||||
- Properties for real client IP and port
|
||||
- Transparent getters that return real or socket IP/port
|
||||
- Pass-through methods for all socket operations
|
||||
- All socket methods/properties delegated via Proxy
|
||||
|
||||
2. **Implement core wrapper functionality** ✅
|
||||
- Constructor accepts regular socket + optional metadata
|
||||
@@ -88,14 +88,13 @@ This phase creates the socket wrapper infrastructure that all subsequent phases
|
||||
|
||||
3. **Update ConnectionManager to handle wrapped sockets** ✅
|
||||
- Accept either `net.Socket` or `WrappedSocket`
|
||||
- Use duck typing or instanceof checks
|
||||
- Ensure all IP lookups use the getter methods
|
||||
- Created `getUnderlyingSocket()` helper for socket utilities
|
||||
- All socket utility functions extract underlying socket
|
||||
|
||||
4. **Create comprehensive tests** ✅
|
||||
- Test wrapper with and without proxy info
|
||||
- Verify getter fallback behavior
|
||||
- Test event forwarding
|
||||
- Test socket method pass-through
|
||||
4. **Integration completed** ✅
|
||||
- All incoming sockets wrapped in RouteConnectionHandler
|
||||
- Socket forwarding verified working with wrapped sockets
|
||||
- Type safety maintained with index signature
|
||||
|
||||
**Deliverables**: ✅ Working WrappedSocket that can wrap any socket and provide transparent access to client info.
|
||||
|
||||
|
Reference in New Issue
Block a user