Registry / web-framework / axum-client-ip

axum-client-ip

JSON →
library1.3.1rscratesunverified

Client IP address extractors for Axum web framework, supporting headers like X-Forwarded-For.

# Cargo.toml [dependencies] axum-client-ip = "1.3.1"
INSTALL
IMPORT
SIG · AXUM-CLIENT-IP
A
axum-client-ip
web-frameworkrustv1.3.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ClientIp
use axum_client_ip::ClientIp;

Extracts client IP from an Axum request.

use axum_client_ip::ClientIp; use axum::{Router, routing::get}; async fn handler(ip: ClientIp) -> String { format!("Your IP: {}", ip.0) } #[tokio::main] async fn main() { let app = Router::new().route("/", get(handler)); axum::Server::bind(&"0.0.0.0:3000".parse().unwrap()) .serve(app.into_make_service()) .await .unwrap(); }
Debug
Known issues
gotchaRequires the `axum` and `tokio` runtime; may need feature flags for header parsing.
fix
Add `axum = "0.7"` and `tokio = { version = "1", features = ["full"] }` to Cargo.toml.
affects: >=1.0.0
Upgrade
Version history
1.3.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
axum-client-ip — cargo add axum-client-ip · libregistry