[undertow-dev] Handler to proxy & log request bodies

Stuart Douglas sdouglas at redhat.com
Mon Aug 10 02:02:10 EDT 2015


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 at spinscale.de>
> To: undertow-dev at 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 at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/undertow-dev


More information about the undertow-dev mailing list