I need to capture all the http/https requests that are going through the browsers of my system using JAVA servlets.
Can I achieve that?
I need to capture all the http/https requests that are going through the browsers of my system using JAVA servlets.
Can I achieve that?
going through the browsers of my system You can do this is with an implementation of
ServletRequestListener::requestInitialized(ServletRequestEvent sre)
The Documentation say:
The class could look like this:
In the console you get something like this:
Instead in the console you can store the data in a DB or write to a log.
If you need to differentiate between local and remote requests you can use
request.getRemoteAddr()
. For local requests it is127.0.0.1