1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
//! Courierust — a self-contained HTTP/1.1 + HTTP/2 + HTTP/3 + WebSocket + gRPC stack.
//!
//! The protocol core (`courierust_http`, `courierust_hpack`,
//! `courierust_h2`, `courierust_ws`, `courierust_deflate`,
//! `courierust_quic`, `courierust_h3`, `courierust_fingerprint`,
//! `courierust_crypto`, `courierust_bytes`, `courierust_io`) compiles on
//! `no_std + alloc` with **zero** third-party dependencies. The `std`
//! feature (enabled by default) adds the threaded networking layer:
//! `courierust_pool` (work-stealing scheduler), `courierust_net`,
//! `courierust_client` (the h1 pool, the h2/h3 drivers and the WebSocket
//! client), `courierust_server` (the event-driven scheduler plus the
//! WebSocket upgrade path) and `courierust_grpc`.
//!
//! Every public module carries the crate's `courierust_` prefix so no
//! module path collides with a third-party crate of the same short name
//! (e.g. `h2`, `http`, `bytes`, `grpc`, `tls`).
//!
//! Design highlights:
//!
//! * **Multi-core parallelism** — a work-stealing thread pool with
//! per-worker LIFO caches and a global FIFO steal queue; client pools are
//! shared per authority, and HTTP/2 requests are assigned to the least
//! reserved accepting driver up to `max_connections_per_host`.
//! * **RFC 9218 client priority frames** (`PRIORITY_UPDATE`, frame type
//! `0x10`) with a Weighted-Urgency Calendar Scheduler (WUCS): eight
//! urgency buckets combined with Deficit Round Robin anti-starvation
//! and round-robin interleaving for incremental streams — O(1)
//! scheduling decision.
//! * **Batched Credit Reflow (BCR)** flow control — received data is
//! acknowledged in batches rather than one `WINDOW_UPDATE` per frame,
//! cutting control-frame overhead.
//! * **Table-driven HPACK** — 8-bit two-level Huffman decode tables and a
//! hash-accelerated static/dynamic header index fast path.
//! * **WebSocket** — RFC 6455 framing, masking, UTF-8 validation, the
//! close handshake and RFC 7692 `permessage-deflate`, in
//! `courierust_ws`. Masking is XORed in 16-byte lanes (a 4-byte
//! repeating key cannot vectorise, but 16 is a multiple of four, so
//! every lane starts at the same key phase), a payload over 8 KiB is
//! read straight into the message buffer instead of through the
//! buffered reader, and the DEFLATE context is reused per message
//! rather than rebuilt. A live HTTP/1.1 connection is upgraded in
//! place by both server drivers — in the event reactor an idle
//! WebSocket costs a poller slot, not a thread — and the client speaks
//! `ws://` / `wss://` over the crate's own TLS stack.
//! * **HTTP/3 over QUIC v1** — `courierust_quic` (packet and frame
//! codecs, varints, header protection, key update) plus `courierust_h3`
//! (QPACK, H3 framing, and a poller-driven UDP reactor whose poll
//! timeout is an absolute protocol deadline rather than a fixed tick).
//! * **Fingerprint profiles** — exact Chrome HTTP/2 settings/header
//! ordering plus JA3/JA4 TLS `ClientHello` parameter profiles with
//! self-contained MD5/SHA-256, so a browser-shaped fingerprint can be
//! fed to an external TLS layer of your choice.
//!
//! TLS 1.3 (RFC 8446) is implemented from scratch under the `std`
//! feature (`courierust_tls` module) — client and server handshakes,
//! X.25519 key exchange, AES-GCM / ChaCha20-Poly1305 record protection,
//! and X.509 chain validation — so `https://` is a first-class
//! capability on both the client and the server. The protocol core stays
//! `no_std + alloc` with zero third-party dependencies; the transport
//! traits let the same codecs also run over an externally supplied TLS
//! stream.
extern crate alloc;
extern crate std;
pub use Bytes;
pub use ;