# tower-rate-limit-fred
[![crates.io](https://img.shields.io/crates/v/tower-rate-limit-fred)](https://crates.io/crates/tower-rate-limit-fred)
[![Documentation](https://img.shields.io/docsrs/tower-rate-limit-fred)](https://docs.rs/tower-rate-limit-fred)

A Redis-backed rate-limiting middleware for Tower using [Fred](https://crates.io/fred).

## Development setup
`podman` is required to spawn Redis servers for tests,
which run on the port set by the `STARTING_REDIS_PORT` environment variable and the 9 subsequent ports.

## Similar crates
- [tower-rate-limit-redis](https://crates.io/crates/tower-rate-limit-redis): the same crate but with [redis-rs](https://crates.io/crates/redis) instead of Fred
- [tower-governor](https://docs.rs/crate/tower_governor/latest): uses the same algorithm but stores data in application memory.
  You might prefer this if your application runs on a single node.

## License
This project is licensed under [MPL-2.0](https://www.mozilla.org/en-US/MPL/2.0/),
except for `scripts/rate_limit.lua`, which is licensed under [MIT](https://opensource.org/license/mit).
