At the moment I'm using storescp like in this diagram:

I am looking for advice to modify and recompile it so it can be used as fuly functional DICOM Proxy service (or perhaps there is already a solution and I invent excess?).
To achieve this:

And this functionality:

I was able to do this in Python, however deploying an additional service between the client and storescp is inefficient plus the python implementation is much much slower.
I am not looking for code itself for sure (despite the fact that I am a complete zero in C++

Thank you!