#trillium #async #framework

trillium-forwarding

handler for trillium.rs that rewrites host/scheme from forwarded/x-forwarded headers

6 releases

0.2.4 Apr 7, 2024
0.2.3 Jan 2, 2024
0.2.2 Dec 20, 2023
0.2.1 Dec 3, 2021
0.1.0 Jul 16, 2021

#1347 in HTTP server

Download history 135/week @ 2024-01-25 59/week @ 2024-02-01 198/week @ 2024-02-08 73/week @ 2024-02-15 127/week @ 2024-02-22 96/week @ 2024-02-29 64/week @ 2024-03-07 75/week @ 2024-03-14 613/week @ 2024-03-21 566/week @ 2024-03-28 1150/week @ 2024-04-04 467/week @ 2024-04-11 250/week @ 2024-04-18 248/week @ 2024-04-25 302/week @ 2024-05-02 275/week @ 2024-05-09

1,176 downloads per month
Used in 3 crates (via trillium-proxy)

MIT/Apache

93KB
1.5K SLoC

Welcome to Trillium!

📖 Guide 📖

The guide provides an architectural overview and lay of the land connecting the trillium crates.

📑 Rustdocs 📑

The rustdocs represent the best way to learn about any of trillium's individual crates and the specific interfaces.




Legal:

Licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

Trillium handler for x-forwarded-* / forwarded

This simple handler rewrites the request's host, secure setting, and peer ip based on headers added by a trusted reverse proxy.

The specific headers that are understood by this handler are:

  • Forwarded
  • or some combination of the following

There are several ways of specifying when to trust a peer ip address, and the narrowest possible trust rules should be used for a given deployment so as to decrease the chance for a threat actor to generate a request with forwarded headers that we mistakenly trust.

Dependencies

~7.5MB
~193K SLoC