http-compress 23.3.2

A high-performance async library for HTTP compression/decompression, supporting Brotli, Deflate, and Gzip algorithms. Provides both compression and decompression capabilities with optimized memory usage, ideal for HTTP clients/servers and network programming.
Documentation

http-compress

Bounded Gzip, Deflate & Brotli HTTP Compression Codecs

Crates.io Version Docs.rs CI Status Rust 2024 License: MIT

Workspace Overview · API Docs


Overview

http-compress provides bounded HTTP payload compression and decompression codecs (gzip, deflate, brotli) and Accept-Encoding negotiation shared by hyperlane servers, clients, and middleware plugins.

Installation

cargo add http-compress

Usage

use std::borrow::Cow;
use http_compress::Compress;

fn compress_payload(payload: &[u8]) -> Cow<'_, [u8]> {
    Compress::Gzip.encode(payload, 4096)
}

Verification

cargo run -p hyperlane-cli -- fmt --check
cargo clippy -p http-compress --all-features --all-targets -- -D warnings
cargo test -p http-compress --all-features

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For inquiries, please contact the author at root@devhub.vip.