hyperium/hyper
72.5
Strong · 28 September 2026
19.9k
lines of production code
Rust
primary language
2
measurements over time
What this system is
This system is the Hyper HTTP library, a high-performance, asynchronous HTTP client and server implementation for Rust. It provides core capabilities for handling HTTP/1.1 and HTTP/2 protocols, including connection management, request/response streaming, and service dispatching. The library also exposes an unstable C API for interoperability and includes extensive benchmarking and integration testing infrastructure to ensure performance and protocol compliance.
How it got here
2014 — Hyper 1.0 and Tokio 1.0 migration
6 changes.
This period focused on upgrading the codebase to Hyper 1.0 and Tokio 1.0, requiring a migration to the Rust 2021 edition and modern async/await patterns. The internal architecture was refactored to introduce a new asynchronous client dispatch system and a dedicated server module, while examples and documentation were updated to reflect the new APIs. Comprehensive benchmarks were also added to validate performance for HTTP/1 and HTTP/2 workloads.
2016–2018 — HTTP/2 support and protocol refactoring
9 changes.
This period focused on introducing HTTP/2 protocol support and refactoring the internal architecture to better separate HTTP/1 and HTTP/2 logic. The codebase migrated body handling to the http-body crate and standardized service traits, while adding comprehensive integration tests for both protocols.
2021–2023 — C API and runtime abstraction
9 changes.
This period focused on introducing an initial unstable C Foreign Function Interface (FFI) to enable Hyper to be called from C applications, alongside comprehensive examples. Concurrently, the library established a new runtime abstraction layer to decouple from specific async runtimes and split client/server connection modules by HTTP version for granular configuration.
Features
Add C API examples for HTTP client and file upload
New example programs (client.c and upload.c) and a Makefile are added to the capi/examples directory, demonstrating how to use the Hyper C API to perform HTTP GET requests and file uploads over non-blocking sockets.
capi/examples · high confidence
Add benchmark support for hyper runtime traits
The \benches/support\ module now provides adapter types (\TokioExecutor\, \TokioTimer\, \TokioIo\) that bridge Tokio's async primitives to \hyper::rt\ traits, enabling end-to-end benchmarks to run against the hyper runtime interface.
benches/support · high confidence
Added IO compatibility and buffering utilities
The \src/common/io\ module now includes a \Compat\ adapter that bridges hyper's internal IO traits with Tokio's \AsyncRead\ and \AsyncWrite\ interfaces, enabling interoperability for components like \h2\. Additionally, a \Rewind\ type has been introduced to allow pre-buffered data to be injected into an IO stream before reading from the underlying connection, supporting scenarios where previous reads need to be logically undone.
src/common/io · high confidence
HTTP/1 and HTTP/2 server connection modules are now public
The \server::conn::http1\ and \server::conn::http2\ modules are now exposed as public API, providing dedicated \Builder\ and \Connection\ types for configuring and managing HTTP/1 and HTTP/2 server connections respectively. This change allows users to explicitly construct and customize server connections for each protocol version, replacing the previous unified \server::conn::Connection\ type. The HTTP/1 builder exposes options such as \half\_close\, \keep\_alive\, \title\_case\_headers\, and \max\_headers\, while the HTTP/2 builder provides configuration for flow control, reset stream limits, and window sizes.
src/server/conn · high confidence
Initial C API (FFI) for hyper
Adds a new unstable C API for hyper, accessible via the \ffi\ feature flag and \RUSTFLAGS='--cfg hyper\_unstable\_ffi'\. This API exposes core HTTP client capabilities to C applications, including connection management (\hyper\_clientconn\), request/response handling (\hyper\_request\, \hyper\_response\), streaming body processing (\hyper\_body\), and a custom async task executor (\hyper\_executor\). It also provides configuration options for HTTP/1 features such as preserving header case and order, and handling obsolete multiline headers.
src/ffi · high confidence
Initial C API (FFI) for hyper
This change introduces the initial C API for hyper, enabling Rust code to be called from C applications. The feature is currently unstable and requires the \--cfg hyper\_unstable\_ffi\ flag to be enabled during compilation. The \capi\ directory now contains the necessary build infrastructure, including a \gen\_header.sh\ script that uses \cargo-expand\ and \cbindgen\ to generate the C header file (\hyper.h\), a \cbindgen.toml\ configuration, and documentation explaining how to build the shared library using \cargo\ or \cargo-c\.
capi · high confidence
Initial C API for Hyper HTTP library
The \capi/include/hyper.h\ header is introduced, providing the initial C Foreign Function Interface (FFI) for the Hyper HTTP library. This header defines the core types, constants, and error codes (such as \hyper\_code\ and \hyper\_task\_return\_type\) required to interact with Hyper's HTTP client connections, requests, responses, and asynchronous task execution from C or other languages via FFI.
capi/include · high confidence
Introduce HTTP/2 protocol support
This change adds the HTTP/2 protocol implementation to the library, introducing new modules for client and server connections, keep-alive pings, and stream upgrades. Users can now establish HTTP/2 connections with configurable options such as flow control windows, header list sizes, and adaptive window sizing. The implementation includes support for the extended CONNECT protocol and graceful shutdown mechanisms.
src/proto/h2 · high confidence
Introduction of hyper-specific Service and HttpService traits
The \src/service\ module now defines hyper's own \Service\ and \HttpService\ traits, replacing previous dependencies on external trait definitions. The \Service\ trait provides a generic asynchronous request-to-response interface with \&self\-based calling, while \HttpService\ acts as a sealed trait alias specifically for HTTP request/response handling. This change introduces \service\_fn\ as a helper to create services from closures and implements \Service\ for reference types (\&S\, \&mut S\, \Box\<S\>\, \Rc\<S\>\, \Arc\<S\>\), enabling easier composition and state sharing in network applications.
src/service · high confidence
Introduction of the server module with connection handling documentation
The server module has been added to the codebase, providing a high-level entry point for HTTP server functionality. It includes documentation explaining that a server listens on a port, parses HTTP requests, and delegates them to a Service, while noting that connection listening is handled externally and HTTP processing is managed via the \conn\ module.
src/server · high confidence
New extensions for non-canonical HTTP/1 reason phrases and 1xx informational callbacks
The \src/ext\ module now exposes two new capabilities for HTTP/1 clients. First, the \ReasonPhrase\ extension allows access to non-canonical reason phrases (e.g., \200 Awesome\ instead of \200 OK\) returned by servers; if a response uses a non-standard phrase, it is available via \response.extensions().get::\<ReasonPhrase\>()\. Second, the \on\_informational()\ function enables registering a callback on a request to handle 1xx informational responses (like \100 Continue\) before the final response is received. These changes enhance protocol-level visibility and control for advanced HTTP/1 use cases.
src/ext · high confidence
New runtime abstraction layer for executors, timers, and I/O
Hyper introduces a new \rt\ module that decouples the library from specific async runtimes by providing its own traits for execution, timing, and I/O. Users can now integrate Hyper with any async runtime by implementing the \Executor\ trait to spawn futures, the \Timer\ trait (which includes a new \now()\ method for overriding the current instant) to manage sleep and deadlines, and the \Read\ and \Write\ traits for asynchronous I/O operations. The module also exposes \ReadBuf\ and \ReadBufCursor\ for safe, incremental buffer management, and provides sealed \Http2ClientConnExec\ and \Http2ServerConnExec\ traits to allow custom executors to handle HTTP/2 connection and stream tasks.
src/rt · high confidence
Architecture
HTTP/1 protocol implementation refactored into dedicated module
The HTTP/1 protocol handling has been reorganized into a new \src/proto/h1\ module, consolidating connection management (\conn.rs\), message decoding (\decode.rs\), encoding (\encode.rs\), I/O buffering (\io.rs\), and request/response role logic (\role.rs\) into a single, structured location. This change introduces a \Dispatcher\ component to manage the interaction between the connection state and the application-level service or client dispatch logic, while also integrating \http\_body::Frame\ for body streaming and supporting configuration options such as header case preservation, title casing, and chunked trailer fields.
src/proto/h1 · high confidence
Behavioural changes
Examples updated to use hyper 1.0 and async/await
The examples in the \examples/\ directory have been rewritten to target hyper 1.0, replacing the legacy \hyper::Server\ API with manual \TcpListener\ loops and \http1::Builder::serve\_connection\. They now use \hyper::client::conn::http1::handshake\ for client connections, \http\_body\_util\ for body handling, and \tokio::main\ for runtime setup. The \README.md\ has been added to document the new examples and their dependencies.
examples · high confidence
HTTP body implementation migrated to the \`http-body\` crate
The body module has been rewritten to implement the \http\_body::Body\ trait instead of the legacy \Payload\ trait, aligning with the \http-body\ ecosystem. This introduces a frame-based API where bodies are consumed via \Frame\ objects (containing data or trailers) through the \poll\_frame\ method, replacing the previous \poll\/\data\ model. The concrete receive-stream type is now \Incoming\, which supports both HTTP/1 (via a new internal channel implementation) and HTTP/2 protocols. Additionally, the module re-exports \Bytes\, \Frame\, and \SizeHint\ from \http-body\ and \bytes\, and documentation now references \http-body-util\ for additional body implementations like \Full\ or \Empty\.
src/body · high confidence
Introduce new asynchronous client dispatch and connection pooling logic
The client module has been refactored to use a new internal dispatch system (\src/client/dispatch.rs\) that manages request sending and response receiving via channels and a 'Giver/Taker' mechanism for back-pressure. This change introduces a new \TrySendError\ type to distinguish between send failures and connection errors, and implements logic to handle connection pooling, retrying failed requests on fresh connections, and managing idle connection timeouts more reliably. The existing tests in \src/client/tests.rs\ have been updated to verify this new dispatch behavior, including scenarios for connection resets and checkout races.
src/client · high confidence
Introduce proto module for HTTP message protocol internals
A new \src/proto\ module has been added to centralize HTTP message protocol logic, exposing internal types such as \MessageHead\, \RequestHead\, and \ResponseHead\ which wrap the \http\ crate's types. This change restructures how HTTP/1 connection states and dispatching statuses (including upgrade handling) are managed internally, providing a cleaner separation for protocol-specific code while maintaining compatibility with existing client and server features.
src/proto · high confidence
Introduce version-specific client connection modules
The client connection API is now split into dedicated \http1\ and \http2\ modules, replacing the previous unified interface. This change introduces version-specific builders and connection types, allowing for protocol-specific configuration and behavior. For HTTP/1, the \Builder\ and \Connection\ types are now isolated in \client::conn::http1\, while HTTP/2 equivalents reside in \client::conn::http2\. This separation enables features like HTTP/2 stream management options and HTTP/1 header parsing configurations to be handled independently, providing a more granular control over client connections.
src/client/conn · high confidence
Refactored internal common utilities and module structure
The \src/common\ module has been reorganized to improve code clarity and performance. A new \BufList\ type was added to optimize buffer handling, and the \date\ module now uses a thread-local cache to reduce allocations for Date headers. The \Time\ abstraction was updated to support a \now()\ method for retrieving the current instant, and the \task\ module now uses \std::convert::Infallible\ instead of the deprecated \Never\ type. Additionally, a \LockResultExt\ trait was introduced to simplify error handling for poisoned mutexes, and various internal helpers like \Either\ and \poll\_fn\ were standardized.
src/common · high confidence
Rust 2021 edition upgrade and async/await migration
The library has been upgraded to the Rust 2021 edition and migrated from the legacy \futures\ and \tokio\ 0.1 APIs to modern \std::future::Future\ and \tokio\ 1.0. This change replaces internal async primitives (such as \AsyncIo\ and \Task\ in mocks) with standard library types, updates the error handling to use \std::error::Error\, and introduces a new \cfg\ macro system in \src/cfg.rs\ to manage feature flags more cleanly. Users will see updated dependency requirements and potentially breaking changes in any code relying on the previous async runtime interfaces.
src · high confidence
Test coverage
Add comprehensive HTTP/1.1 integration and edge-case tests; Added HTTP/1 and HTTP/2 end-to-end and body benchmarks; Added test support infrastructure for HTTP/2 trailers and parallel testing.
Dependencies
Hyper 1.0 release with Tokio 1 and http 1.0 dependencies
This update upgrades the hyper HTTP library to version 1.0, aligning it with the stable Tokio 1.0 runtime and the http 1.0 crate. The package now requires Rust 1.63 and adopts the 2021 edition. To improve modularity and reduce default binary size, the library switches to a minimal default feature set, requiring users to explicitly enable capabilities like \http1\, \http2\, \client\, and \server\ via Cargo features.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 71 → 72 (+1.8)
- Rubric changed (rubric-2026.09.8 → rubric-2026.09.16) — scores are not directly comparable.
Lenses
- Code Health 89 → 89 (+0.3)
- Architecture 88 → 84 (-4.2)
- Maturity 64 → 64 (+0.3)
- Readiness 82 → 84 (+1.9)
- Security 67 → 73 (+6.6)
- Performance 100 (new)
Resolved (11)
- Documentation: written for insiders (docs/COLLABORATORS.md)
- Duplicated block (17–18 lines × 2) (src/client/conn/http1.rs)
- Duplicated block (20 lines × 2) (src/client/conn/http1.rs)
- Further sole-owners (lower concentration)
- Hotspot: src/proto/h1/dispatch.rs (src/proto/h1/dispatch.rs)
- Hotspot: src/proto/h2/client.rs (src/proto/h2/client.rs)
- Hotspot: src/proto/h2/mod.rs (src/proto/h2/mod.rs)
- Hotspot: src/proto/h2/upgrade.rs (src/proto/h2/upgrade.rs)
- Off-boarding risk: anonymized user #1
- TodoComment (src/ext/h1_reason_phrase.rs)
- UpgradedSendStreamTask::tick (cognitive 21) (src/proto/h2/upgrade.rs)
New (11)
- Dependency hygiene PARTLY measured — Cargo dependencies read, no committed lock to grade for currency
- Duplicate accessor methods for the error field. into_error and error are redundant. In Rust, into_* usually implies consuming the value, while *() implies borrowing. Having both without clear distinction in signature (e.g., &Error vs Error) is confusing.
- Duplicate accessor methods for the same underlying data. take_message and message appear to provide identical functionality (accessing the contained request), likely differing only in ownership semantics (move vs borrow) but named inconsistently with standard Rust conventions (usually into_inner/as_ref or take/get).
- Duplicated block (12 lines × 2) (src/proto/h2/mod.rs)
- Duplicated block (17–18 lines × 2) (src/client/conn/http1.rs)
- Duplicated block (20 lines × 2) (src/client/conn/http1.rs)
- Inconsistent parameter naming across Builder methods. Some use enabled: bool (e.g., http09_responses, title_case_headers), while others use val: bool (e.g., half_close, writev, keep_alive). This creates visual noise and inconsistency in the API surface.
- Off-boarding risk: anonymized user #1
- Projects may be oversized for their cohesion
- Redundant readiness checks. is_ready() returns a boolean, while ready() returns a Result. In async contexts, ready() is typically the blocking/polling operation, while is_ready() is a non-blocking peek. However, having both on the same type often leads to misuse where is_ready() is checked before calling ready(), which is unnecessary if ready() is the correct async primitive.
- Signature collision or ambiguity. The list shows Connection.without_shutdown() appearing twice with different return types (Result vs impl Future). This suggests either an overload that isn't clearly distinguished by parameters, or a documentation error where one is a blocking version and one is async, but they share the same name.
Changes since last survey
- 5 commits — 3 feature/other, 2 fixes
By area
- src/proto — 2 commits
- (root) — 1 commit
- capi/README.md — 1 commit
- src/client — 1 commit
Notable commits
- fix: fix(http1): preserve hop-by-hop when setting close or keep-alive (#4196)
- fix: fix(http2): do not reserve capacity for idle Upgraded streams (#4198)
- change: docs: fix three typos (#4204)
- change: style(lib): address clippy panics and missing_panics_doc lints (#4191)
- change: style(lib): address ignored_unit_patterns lint (#4193)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
hyperium/hyper was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 28 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit e60932da8fb37c0060ff929bfc9dc234e2e44e8b — the exact code this score is about.
- Scored under rubric-2026.09.16 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-d46da229e3fd.