I have the following setup:
- Closed-source Client A where I can set the IP of B
- Closed-source Server B, fixed IP
- Server C, written by me
A communicates with B over HTTP. I've cloned the API and implemented it myself in C, as I am interested in the data, but I still require A to talk to B, which is why I can't just let the client connect to C. So I'd like to put my C transparently in the middle between A and B without changing any data that is sent between A and B.
My idea was to set up some sort of reverse proxy D that waits for requests from A, sends them to both B and C and then passes the result returned by B back to A.
I hope it's clear what I'm trying to do. I've tried to set this up with mod_proxy or mod_proxy_balancer but they were not made for this and only pass the request to one target. Any other ideas?