I would like to send a custom response before any request hit to any web server like APACHE, NGINX or any other.

I heard about Content-filtering and Packet-filtering. So I am not looking for the filtering process.

Actually I am looking for intercepting request and sending a custom response.


This is a job for an proxy server. Specifically, mitmproxy has a Python API that can be used to automatically send a custom response programmatically, (See: https://docs.mitmproxy.org/stable/addons-scripting).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.