Announcing tower-http

submited by
Style Pass
2021-05-29 17:00:02

Today I'm excited to announce tower-http, which is a collection of HTTP specific middleware and utilities built with Tower's Service trait.

Tower itself contains middleware that are all protocol agnostic. For example its timeout middleware is compatible with any Service implementation regardless of which protocol it uses. That is great because it means the middleware is more reusable but it also means you cannot use protocol specific features. In the case of HTTP it means none of the middleware in Tower knows about status codes, headers, or other HTTP specific features.

tower-http on the other hand contains middleware that are specific to HTTP. It uses the http and http-body crates meaning its compatible with any crate that also uses those, such as hyper, tonic, and warp.

The goal of tower-http is to provide a rich set of middleware for solving common problems when building HTTP clients and servers. Some highlights are:

Leave a Comment