pub enum ClientIp {
Socket,
Header(String),
TrustedProxies {
header: String,
proxies: usize,
},
}Expand description
Where the client IP comes from. Rate limits are kept per client IP, and sessions record it.
The first request whose IP can’t be read is logged. Such requests are rate-limited per
account their JSON body names (email or username), and otherwise share one bucket.
Variants§
Socket
The socket address the integration puts in request extensions (default). In axum,
serve with into_make_service_with_connect_info::<SocketAddr>().
Header(String)
A header holding exactly one IP address, set by a proxy you trust that overwrites
whatever the client sent, e.g. fly-client-ip or cf-connecting-ip. Any other value
counts as no IP. Never x-forwarded-for: proxies append to it, so the client writes
its start. Use TrustedProxies for that.
TrustedProxies
A header that each proxy appends to, like x-forwarded-for. proxies is how many
proxies you run in front of the app; the client is the proxies-th address from the
right, because everything left of it was sent by the client.