Access RemoteAddr inside of TraceLayer #428
-
I'm currently building a web server with Axum, and I''m using |
Beta Was this translation helpful? Give feedback.
Answered by
davidpdrsn
Oct 25, 2023
Replies: 1 comment 2 replies
-
You can get https://docs.rs/axum/0.6.20/axum/extract/struct.ConnectInfo.html from the request extensions. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You don’t need the Extension extractor. You can just do
request.extensions().get::<ConnectInfo<SocketAddr>>()