actix-ipquery-0.1.3 has been yanked.
actix-ipquery
Overview
actix-ipquery is an Actix Web middleware that allows you to query IP information using the ipapi crate and store the results using a custom store that implements the IPQueryStore trait. It supports querying the IP address from either the X-Forwarded-For header or the peer address of the request.
Features
- Query IP information using a specified endpoint.
- Store IP information using a custom store.
- Option to use the
X-Forwarded-Forheader for IP address extraction.
Installation
Add the following to your Cargo.toml:
[]
= "4"
= "*"
Usage
Here is a basic example of how to use actix-ipquery:
use ;
use ;
;
async
Configuration
You can configure the middleware to use a custom endpoint and the X-Forwarded-For header:
let ip_query = new
.endpoint
.forwarded_for
.finish;
License
This project is licensed under the MIT License.