-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Description
My application listens on 0.0.0.0:80 and 0.0.0.0:443. My server has multiple network cards with different IP addresses. I need to get my local interface IP address where the client is connecting to. In raw axum::serve I can use the following:
#[derive(Clone, Debug)]
pub struct LocalSocketInfo {
pub local_addr: IpAddr,
}
impl Connected<IncomingStream<'_, TcpListener>> for LocalSocketInfo {
fn connect_info(target: IncomingStream<'_, TcpListener>) -> Self {
LocalSocketInfo {
local_addr: target.io().local_addr().unwrap().ip(),
}
}
}
However when using axum-server and openssl, it is impossible to get this information.
Metadata
Metadata
Assignees
Labels
No labels