-
I'm using Helidon MP, and have written a ContainerRequestFilter that logs some information about the request. I want to log the client's IP address. Most solutions I've seen have a servlet request injected, but Helidon is not servlet based. The only thing I found is the ContainerRequestContext has a property called "io.helidon.jaxrs.remote-host" which has the client's IP address, and that works great. I can't find this property documented anywhere, and my concern that this can go away in the future. Is this the "official" way to get the client IP address, or should I be doing something else. I'm also checking the headers X-Forwarded-For and friends for completeness, but my service doesn't have a proxy between it and the the client. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I think there is no official way to get these. I opened an issue for this #9818 to clarify the situation |
Beta Was this translation helpful? Give feedback.
-
@romain-grecourt mentioned injecting @Inject
ServerRequest serverRequest;
...
serverRequest.remotePeer().host(); |
Beta Was this translation helpful? Give feedback.
@romain-grecourt mentioned injecting
ServerRequest
and access client information from there.