112 lines
3.8 KiB
Markdown
112 lines
3.8 KiB
Markdown
# Protocol Detection Reorganization Plan
|
||
|
||
## Current Issues
|
||
|
||
1. **Triple Fragment Handling**: Three separate implementations of fragment buffering:
|
||
- `TlsDetector.detectWithFragments()`
|
||
- `HttpDetector.detectWithFragments()`
|
||
- `ClientHelloParser.handleFragmentedClientHello()`
|
||
|
||
2. **Overlapping Responsibilities**:
|
||
- Detectors are parsing full protocol details (ALPN, cipher suites, headers)
|
||
- Direct coupling between detectors and protocol parsers
|
||
- Detection and parsing are intermingled
|
||
|
||
3. **Unclear Boundaries**:
|
||
- Detection should be "what protocol?" but it's doing "parse everything"
|
||
- SNI extraction happens in both detection and SNI handler
|
||
|
||
## Proposed Reorganization
|
||
|
||
### 1. Simplify Detection Layer
|
||
- Make detectors lightweight - only identify protocol type
|
||
- Remove full parsing from detectors
|
||
- Return minimal routing info (protocol type, maybe domain)
|
||
|
||
### 2. Create Shared Fragment Handler
|
||
```
|
||
ts/protocols/common/
|
||
|