I think the best way capture the data is to use the HttpServerExchange methods
addRequestWrapper and addResponseWrapper.
These allow you to implement a Conduit that can see all the data as it is being
read/written.
Stuart
----- Original Message -----
From: "Alexander Reelsen" <alr(a)spinscale.de>
To: undertow-dev(a)lists.jboss.org
Sent: Saturday, 8 August, 2015 11:03:36 PM
Subject: [undertow-dev] Handler to proxy & log request bodies
Hey,
I am currently taking a look at undertow in order to write a small proxy
(which is dead easy), that should log the incoming request into another data
sink, then forward the request to the proxy, receive the response and log
some parts of the JSON response (together with the request data) into that
data sink plus forwarding it back to client.
Just reading the input stream in a special proxy handler does not seem to
work, so I guess there is a much smarter solution, like one of the listeners
I could add to an exchange.
Any help is highly appreciated. Thanks a lot!
--Alex
_______________________________________________
undertow-dev mailing list
undertow-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/undertow-dev