Commit 16e131e
Apu Islam
feat(http2): implement 103 Early Hints support
Add complete HTTP/2 103 Early Hints implementation with client and server support:
- Add InformationalSender extension for server-side hint transmission via mpsc channel
- Create InformationalCallback system for client-side informational response handling
- Extend HTTP/2 client builder with informational_responses() configuration method
- Implement informational response polling in h2 client task with callback invocation
- Add server-side informational response forwarding using h2's send_informational API
- Include extensive integration tests covering multiple scenarios and edge cases
- Add `enable_informational` config field (defaults to false) and conditional channel creation per request
- Add complete working example with TLS, resource preloading, and performance monitoring
- Update Cargo.toml with local h2 dependency and example build configuration
The implementation enables servers to send resource preload hints before final responses,
allowing browsers to start downloading critical resources early and improve page load
performance. Clients can register callbacks to process 103 Early Hints and other
informational responses.
Closes #3980, #24261 parent 46eef50 commit 16e131e
14 files changed
Lines changed: 2593 additions & 9 deletions
File tree
- examples
- src
- client/conn
- ext
- proto
- h1
- h2
- server/conn
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
| |||
86 | 90 | | |
87 | 91 | | |
88 | 92 | | |
89 | | - | |
| 93 | + | |
90 | 94 | | |
91 | 95 | | |
92 | 96 | | |
| |||
305 | 309 | | |
306 | 310 | | |
307 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
308 | 317 | | |
309 | 318 | | |
310 | 319 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
0 commit comments