#io #async #futures #service #http


Tower middleware and utilities for HTTP clients and servers

14 releases

0.4.0 Feb 24, 2023
0.3.5 Dec 2, 2022
0.3.4 Jun 6, 2022
0.2.5 Mar 11, 2022
0.0.0 Mar 10, 2017

#10 in Network programming

Download history 260647/week @ 2022-12-05 260323/week @ 2022-12-12 231100/week @ 2022-12-19 137313/week @ 2022-12-26 234620/week @ 2023-01-02 295236/week @ 2023-01-09 288939/week @ 2023-01-16 302336/week @ 2023-01-23 339029/week @ 2023-01-30 319493/week @ 2023-02-06 323664/week @ 2023-02-13 321645/week @ 2023-02-20 355350/week @ 2023-02-27 376251/week @ 2023-03-06 344450/week @ 2023-03-13 325853/week @ 2023-03-20

1,422,108 downloads per month
Used in 422 crates (167 directly)

MIT license

13K SLoC

Tower HTTP

Tower middleware and utilities for HTTP clients and servers.

Build status Crates.io Documentation Crates.io

More information about this crate can be found in the crate documentation.


Tower HTTP contains lots of middleware that are generally useful when building HTTP servers and clients. Some of the highlights are:

  • Trace adds high level logging of requests and responses. Supports both regular HTTP requests as well as gRPC.
  • Compression and Decompression to compress/decompress response bodies.
  • FollowRedirect to automatically follow redirection responses.

See the docs for the complete list of middleware.

Middleware uses the http crate as the HTTP interface so they're compatible with any library or framework that also uses http. For example hyper.

The middleware were originally extracted from one of @EmbarkStudios internal projects.


The examples folder contains various examples of how to use Tower HTTP:

Minimum supported Rust version

tower-http's MSRV is 1.60.

Getting Help

If you're new to tower its guides might help. In the tower-http repo we also have a number of examples showing how to put everything together. You're also welcome to ask in the #tower Discord channel or open an issue with your question.


🎈 Thanks for your help improving the project! We are so happy to have you! We have a contributing guide to help you get involved in the Tower HTTP project.


This project is licensed under the MIT license.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Tower HTTP by you, shall be licensed as MIT, without any additional terms or conditions.


~140K SLoC