Search code examples
pythonhttphttprequesthttpresponsemitmproxy

How to send back a fake response(header and body) from an intercepted request via mitmproxy


I need a way using python3 and mitmproxy and any other python3 libraries (if posssible) to fake(simulate) a full response(header and body) by intercepting the filtered request and reply back with a fake response without even sending the real request to the server.

TIA.


Solution

  • You can either use mitmproxy's server replay feature, or script it yourself manually: examples/addons/http-reply-from-proxy.py.