Netty currently has a PcapWriteHandler which is used to save streams. We add an additional handler when we insert an sslhandler, to save cleartext.
Pcapng has support for things like ssl session keys (see https://jsslkeylog.github.io/), which can be used to automatically decrypt ssl data, as well as support for vendor extensions, which could be used to record modifications, etc. Changes could also be inferred on load by comparing client to proxy and proxy to server streams, though. Still need a link between the two streams, which could go into a vendor field.
Still need to consider how this would work for UDP.