blob: eefe08fb0d181cf4ce90286d2c8b53bce3dfe57b (
plain)
1
2
3
4
5
6
7
|
use axum::{extract::ConnectInfo, response::IntoResponse};
use std::net::SocketAddr;
/// Returns IP address of caller as a string
pub async fn host_ip(ConnectInfo(addr): ConnectInfo<SocketAddr>) -> impl IntoResponse {
addr.ip().to_string()
}
|