talira

A protective and efficient HTTP library for all.

open sourceMITself-hostablefree

hyper is a low-level, asynchronous HTTP library for Rust with both client and server APIs, speaking HTTP/1 and HTTP/2. It's meant as a building block: it makes few assumptions about the application or its environment, so other libraries and frameworks put a friendlier API on top, among them the reqwest client and the axum and warp web frameworks. Client, server, HTTP/1 and HTTP/2 are each Cargo features, and an unstable C API (the ffi feature) exposes it to other languages. Its guides run it on Tokio, and its executor and I/O traits let other runtimes plug in. It belongs to the hyperium GitHub organization and was created by Sean McArthur.

Problems it solves

  • build my own HTTP server in Rust with full control over connections and request handling
  • write a Rust HTTP client or proxy at the protocol level without a framework's opinions
  • I need HTTP/1 and HTTP/2 support for a Rust service handling many concurrent connections
  • build a reverse proxy or gateway in Rust that forwards requests between clients and backends
  • an HTTP implementation I can call from C or another language through an FFI
  • build a web framework or HTTP client library in Rust on a tested HTTP core
  • a memory-safe HTTP implementation for a high-traffic service

Features

  • client and server APIs
  • HTTP/1 and HTTP/2
  • asynchronous design with non-blocking sockets
  • Cargo features for client, server, http1 and http2
  • unstable C API through the ffi feature
  • unstable tracing support
  • guides for clients and servers on hyper.rs

Limitations

  • Doesn't provide a convenient high-level HTTP client: it's a low-level building block, and its README points to reqwest1
  • Doesn't support HTTP/3 yet: HTTP/1 and HTTP/2 only, with HTTP/3 in the works2

Capabilities

Has an APIplan not known

Alternatives

The same job

These do what hyper does.

  1. reqwest An ergonomic, batteries-included HTTP Client for Rust.
  2. Isahc The practical HTTP client that is fun to use.
  3. ureq A simple, safe HTTP client

Compare hyper with the top 3