rwebtransport 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/Cargo.lock +666 -666
  2. package/Cargo.toml +31 -31
  3. package/LICENSE +202 -202
  4. package/NOTICE +41 -41
  5. package/README.md +550 -550
  6. package/crates/echo-server/Cargo.toml +20 -20
  7. package/crates/echo-server/src/main.rs +666 -666
  8. package/crates/native/Cargo.toml +23 -23
  9. package/crates/native/src/config.rs +129 -129
  10. package/crates/native/src/driver.rs +463 -463
  11. package/crates/native/src/lib.rs +821 -821
  12. package/crates/native/src/server.rs +718 -718
  13. package/crates/native/src/session.rs +1191 -1191
  14. package/crates/native/src/tls.rs +96 -96
  15. package/crates/wtcore/Cargo.toml +15 -15
  16. package/crates/wtcore/src/h3.rs +226 -226
  17. package/crates/wtcore/src/lib.rs +9 -9
  18. package/dist/index.js.map +1 -1
  19. package/dist/index.mjs.map +1 -1
  20. package/package.json +80 -79
  21. package/prebuilds/darwin-arm64/rwebtransport.node +0 -0
  22. package/prebuilds/linux-arm64/rwebtransport.node +0 -0
  23. package/prebuilds/linux-x64/rwebtransport.node +0 -0
  24. package/prebuilds/win32-x64/rwebtransport.node +0 -0
  25. package/scripts/bench.mjs +180 -180
  26. package/scripts/build.js +67 -67
  27. package/scripts/postinstall.js +67 -67
  28. package/scripts/setup-unix.sh +129 -129
  29. package/scripts/setup-windows.ps1 +229 -229
  30. package/vendor/quiche/AGENTS.md +75 -75
  31. package/vendor/quiche/COPYING +23 -23
  32. package/vendor/quiche/Cargo.lock +1212 -1212
  33. package/vendor/quiche/Cargo.toml +215 -215
  34. package/vendor/quiche/README.md +466 -466
  35. package/vendor/quiche/examples/Makefile +46 -46
  36. package/vendor/quiche/examples/README.md +20 -20
  37. package/vendor/quiche/examples/cert-big.crt +90 -90
  38. package/vendor/quiche/examples/cert.crt +18 -18
  39. package/vendor/quiche/examples/cert.key +28 -28
  40. package/vendor/quiche/examples/client.c +343 -343
  41. package/vendor/quiche/examples/client.rs +281 -281
  42. package/vendor/quiche/examples/gen-certs.sh +15 -15
  43. package/vendor/quiche/examples/http3-client.c +473 -473
  44. package/vendor/quiche/examples/http3-client.rs +349 -349
  45. package/vendor/quiche/examples/http3-server.c +614 -614
  46. package/vendor/quiche/examples/http3-server.rs +680 -680
  47. package/vendor/quiche/examples/qpack-decode.rs +87 -87
  48. package/vendor/quiche/examples/qpack-encode.rs +88 -88
  49. package/vendor/quiche/examples/rootca.crt +21 -21
  50. package/vendor/quiche/examples/server.c +529 -529
  51. package/vendor/quiche/examples/server.rs +529 -529
  52. package/vendor/quiche/include/quiche.h +1282 -1282
  53. package/vendor/quiche/src/buffers.rs +105 -105
  54. package/vendor/quiche/src/build.rs +66 -66
  55. package/vendor/quiche/src/cid.rs +1079 -1079
  56. package/vendor/quiche/src/crypto/boringssl.rs +373 -373
  57. package/vendor/quiche/src/crypto/mod.rs +671 -671
  58. package/vendor/quiche/src/dgram.rs +118 -118
  59. package/vendor/quiche/src/error.rs +263 -263
  60. package/vendor/quiche/src/ffi.rs +2290 -2290
  61. package/vendor/quiche/src/flowcontrol.rs +246 -246
  62. package/vendor/quiche/src/frame.rs +2172 -2172
  63. package/vendor/quiche/src/h3/AGENTS.md +54 -54
  64. package/vendor/quiche/src/h3/ffi.rs +442 -442
  65. package/vendor/quiche/src/h3/frame.rs +1404 -1404
  66. package/vendor/quiche/src/h3/mod.rs +8223 -8223
  67. package/vendor/quiche/src/h3/qpack/decoder.rs +288 -288
  68. package/vendor/quiche/src/h3/qpack/encoder.rs +235 -235
  69. package/vendor/quiche/src/h3/qpack/mod.rs +202 -202
  70. package/vendor/quiche/src/h3/qpack/static_table.rs +323 -323
  71. package/vendor/quiche/src/h3/stream.rs +1595 -1595
  72. package/vendor/quiche/src/lib.rs +9556 -9556
  73. package/vendor/quiche/src/minmax.rs +446 -446
  74. package/vendor/quiche/src/packet.rs +2334 -2334
  75. package/vendor/quiche/src/path.rs +1374 -1374
  76. package/vendor/quiche/src/pmtud.rs +652 -652
  77. package/vendor/quiche/src/rand.rs +64 -64
  78. package/vendor/quiche/src/range_buf.rs +186 -186
  79. package/vendor/quiche/src/ranges.rs +755 -755
  80. package/vendor/quiche/src/recovery/AGENTS.md +80 -80
  81. package/vendor/quiche/src/recovery/bandwidth.rs +565 -565
  82. package/vendor/quiche/src/recovery/bytes_in_flight.rs +179 -179
  83. package/vendor/quiche/src/recovery/congestion/cubic.rs +1038 -1038
  84. package/vendor/quiche/src/recovery/congestion/delivery_rate.rs +514 -514
  85. package/vendor/quiche/src/recovery/congestion/hystart.rs +241 -241
  86. package/vendor/quiche/src/recovery/congestion/mod.rs +361 -361
  87. package/vendor/quiche/src/recovery/congestion/prr.rs +238 -238
  88. package/vendor/quiche/src/recovery/congestion/recovery.rs +1170 -1170
  89. package/vendor/quiche/src/recovery/congestion/reno.rs +291 -291
  90. package/vendor/quiche/src/recovery/congestion/test_sender.rs +201 -201
  91. package/vendor/quiche/src/recovery/gcongestion/bbr/bandwidth_sampler.rs +1947 -1947
  92. package/vendor/quiche/src/recovery/gcongestion/bbr/windowed_filter.rs +158 -158
  93. package/vendor/quiche/src/recovery/gcongestion/bbr.rs +37 -37
  94. package/vendor/quiche/src/recovery/gcongestion/bbr2/drain.rs +120 -120
  95. package/vendor/quiche/src/recovery/gcongestion/bbr2/mode.rs +318 -318
  96. package/vendor/quiche/src/recovery/gcongestion/bbr2/network_model.rs +784 -784
  97. package/vendor/quiche/src/recovery/gcongestion/bbr2/probe_bw.rs +729 -729
  98. package/vendor/quiche/src/recovery/gcongestion/bbr2/probe_rtt.rs +175 -175
  99. package/vendor/quiche/src/recovery/gcongestion/bbr2/startup.rs +190 -190
  100. package/vendor/quiche/src/recovery/gcongestion/bbr2.rs +855 -855
  101. package/vendor/quiche/src/recovery/gcongestion/mod.rs +275 -275
  102. package/vendor/quiche/src/recovery/gcongestion/pacer.rs +294 -294
  103. package/vendor/quiche/src/recovery/gcongestion/recovery.rs +1384 -1384
  104. package/vendor/quiche/src/recovery/mod.rs +3086 -3086
  105. package/vendor/quiche/src/recovery/rtt.rs +152 -152
  106. package/vendor/quiche/src/stream/mod.rs +2210 -2210
  107. package/vendor/quiche/src/stream/recv_buf.rs +1236 -1236
  108. package/vendor/quiche/src/stream/send_buf.rs +849 -849
  109. package/vendor/quiche/src/test_utils.rs +681 -681
  110. package/vendor/quiche/src/tests.rs +12922 -12922
  111. package/vendor/quiche/src/tls/boringssl.rs +375 -375
  112. package/vendor/quiche/src/tls/mod.rs +1245 -1245
  113. package/vendor/quiche/src/transport_params.rs +628 -628
@@ -1,54 +1,54 @@
1
- # quiche/src/h3/ — HTTP/3 Module
2
-
3
- ## OVERVIEW
4
-
5
- HTTP/3 wire protocol over QUIC. `Connection` manages H3 state (streams, QPACK, SETTINGS, GOAWAY) on top of `quiche::Connection<F>`. Event-driven: caller loops `poll()` → `Event`. Own `Error`/`Result` types, separate from `quiche::Error`.
6
-
7
- ## STRUCTURE
8
-
9
- ```
10
- mod.rs (7549 lines) H3 Connection, Config, Error, Event, Header, NameValue, Priority
11
- stream.rs (1565) H3 stream state machine (Type, State enums; frame parsing FSM)
12
- frame.rs (1337) H3 frame encode/decode (Frame enum, settings constants)
13
- ffi.rs C FFI for H3 — behind `ffi` feature
14
- qpack/
15
- mod.rs Re-exports
16
- encoder.rs QPACK encoder
17
- decoder.rs QPACK decoder
18
- static_table.rs Static header table (RFC 9204)
19
- ```
20
-
21
- ## WHERE TO LOOK
22
-
23
- | Task | Location |
24
- |------|----------|
25
- | Send/recv requests+responses | `mod.rs` — `send_request()`, `send_response()`, `poll()` |
26
- | Body data | `mod.rs` — `send_body()`, `recv_body()` |
27
- | Priority handling | `mod.rs` — `Priority` struct, `send_priority_update_for_request()` |
28
- | H3 stream lifecycle | `stream.rs` — `Stream` struct, `State` FSM |
29
- | Frame wire format | `frame.rs` — `Frame` enum, `encode()`/`decode()` |
30
- | QPACK header compression | `qpack/encoder.rs`, `qpack/decoder.rs` |
31
- | H3 C API | `ffi.rs` |
32
-
33
- ## ANTI-PATTERNS
34
-
35
- - **h3::Error != quiche::Error.** 19 variants; `TransportError(quiche::Error)` wraps transport errors. Don't confuse.
36
- - **`Error::Done` is success** in poll/read loops. Not a failure — signals "no more work".
37
- - **`to_wire()` maps `BufferTooShort` → `0x999`** — non-standard wire code. Don't propagate this pattern.
38
- - **`to_c()` skips -12** — was previously `TransportError`. Gap is intentional for ABI stability.
39
- - **`to_c()` for `TransportError`:** offsets by `-1000` from underlying `quic_error.to_c()`.
40
- - **`send_request()` sends empty `b""` to create QUIC stream** before writing headers. Required because QUIC stream doesn't exist until first write.
41
- - **stream.rs `Stream` ≠ quiche::stream::Stream.** H3 stream is a frame-parsing state machine layered on top.
42
-
43
- ## NOTES
44
-
45
- - Methods are generic over `F: BufFactory` (zero-copy) and `T: NameValue` (header access).
46
- - `NameValue` trait: `name() -> &[u8]`, `value() -> &[u8]`. Blanket impl for `(N, V)` tuples.
47
- - `Header` is `(Vec<u8>, Vec<u8>)` newtype implementing `NameValue`.
48
- - `Event` variants: `Headers`, `Data`, `Finished`, `Reset(u64)`, `PriorityUpdate`, `GoAway`.
49
- - Priority: RFC 9218 Extensible Priorities. `sfv` feature enables `TryFrom` parsing.
50
- - `PRIORITY_URGENCY_OFFSET = 124` maps external urgency 0-7 to internal quiche priority.
51
- - `APPLICATION_PROTOCOL = &[b"h3"]` — ALPN constant.
52
- - `From<quiche::Error>` converts `Done→Done`, everything else → `TransportError(e)`.
53
- - `From<octets::BufferTooShortError>` → `Error::BufferTooShort`.
54
- - All `#[cfg(feature = "qlog")]` instrumentation inline in mod.rs — heavy conditional compilation.
1
+ # quiche/src/h3/ — HTTP/3 Module
2
+
3
+ ## OVERVIEW
4
+
5
+ HTTP/3 wire protocol over QUIC. `Connection` manages H3 state (streams, QPACK, SETTINGS, GOAWAY) on top of `quiche::Connection<F>`. Event-driven: caller loops `poll()` → `Event`. Own `Error`/`Result` types, separate from `quiche::Error`.
6
+
7
+ ## STRUCTURE
8
+
9
+ ```
10
+ mod.rs (7549 lines) H3 Connection, Config, Error, Event, Header, NameValue, Priority
11
+ stream.rs (1565) H3 stream state machine (Type, State enums; frame parsing FSM)
12
+ frame.rs (1337) H3 frame encode/decode (Frame enum, settings constants)
13
+ ffi.rs C FFI for H3 — behind `ffi` feature
14
+ qpack/
15
+ mod.rs Re-exports
16
+ encoder.rs QPACK encoder
17
+ decoder.rs QPACK decoder
18
+ static_table.rs Static header table (RFC 9204)
19
+ ```
20
+
21
+ ## WHERE TO LOOK
22
+
23
+ | Task | Location |
24
+ |------|----------|
25
+ | Send/recv requests+responses | `mod.rs` — `send_request()`, `send_response()`, `poll()` |
26
+ | Body data | `mod.rs` — `send_body()`, `recv_body()` |
27
+ | Priority handling | `mod.rs` — `Priority` struct, `send_priority_update_for_request()` |
28
+ | H3 stream lifecycle | `stream.rs` — `Stream` struct, `State` FSM |
29
+ | Frame wire format | `frame.rs` — `Frame` enum, `encode()`/`decode()` |
30
+ | QPACK header compression | `qpack/encoder.rs`, `qpack/decoder.rs` |
31
+ | H3 C API | `ffi.rs` |
32
+
33
+ ## ANTI-PATTERNS
34
+
35
+ - **h3::Error != quiche::Error.** 19 variants; `TransportError(quiche::Error)` wraps transport errors. Don't confuse.
36
+ - **`Error::Done` is success** in poll/read loops. Not a failure — signals "no more work".
37
+ - **`to_wire()` maps `BufferTooShort` → `0x999`** — non-standard wire code. Don't propagate this pattern.
38
+ - **`to_c()` skips -12** — was previously `TransportError`. Gap is intentional for ABI stability.
39
+ - **`to_c()` for `TransportError`:** offsets by `-1000` from underlying `quic_error.to_c()`.
40
+ - **`send_request()` sends empty `b""` to create QUIC stream** before writing headers. Required because QUIC stream doesn't exist until first write.
41
+ - **stream.rs `Stream` ≠ quiche::stream::Stream.** H3 stream is a frame-parsing state machine layered on top.
42
+
43
+ ## NOTES
44
+
45
+ - Methods are generic over `F: BufFactory` (zero-copy) and `T: NameValue` (header access).
46
+ - `NameValue` trait: `name() -> &[u8]`, `value() -> &[u8]`. Blanket impl for `(N, V)` tuples.
47
+ - `Header` is `(Vec<u8>, Vec<u8>)` newtype implementing `NameValue`.
48
+ - `Event` variants: `Headers`, `Data`, `Finished`, `Reset(u64)`, `PriorityUpdate`, `GoAway`.
49
+ - Priority: RFC 9218 Extensible Priorities. `sfv` feature enables `TryFrom` parsing.
50
+ - `PRIORITY_URGENCY_OFFSET = 124` maps external urgency 0-7 to internal quiche priority.
51
+ - `APPLICATION_PROTOCOL = &[b"h3"]` — ALPN constant.
52
+ - `From<quiche::Error>` converts `Done→Done`, everything else → `TransportError(e)`.
53
+ - `From<octets::BufferTooShortError>` → `Error::BufferTooShort`.
54
+ - All `#[cfg(feature = "qlog")]` instrumentation inline in mod.rs — heavy conditional compilation.