# Transparent mode, unable to prevent mitmproxy from contacting upstream server

**URL:** <https://discourse.mitmproxy.org/t/transparent-mode-unable-to-prevent-mitmproxy-from-contacting-upstream-server/1358>\
**Category:** help\
**Created:** [December 21, 2018, 4:46pm UTC](https://discourse.mitmproxy.org/t/transparent-mode-unable-to-prevent-mitmproxy-from-contacting-upstream-server/1358 "2018-12-21T16:46:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wsgcsysadmin](https://avatars.discourse-cdn.com/v4/letter/w/71c47a/32.png) [@wsgcsysadmin](https://discourse.mitmproxy.org/u/wsgcsysadmin)\
**Post date:** [December 21, 2018, 4:46pm UTC](https://discourse.mitmproxy.org/t/transparent-mode-unable-to-prevent-mitmproxy-from-contacting-upstream-server/1358/1 "2018-12-21T16:46:04Z")

</div>

Similar to:  
[https://discourse.mitmproxy.org/t/return-response-directly-no-request-to-target-domain-or-server](https://discourse.mitmproxy.org/t/return-response-directly-no-request-to-target-domain-or-server)

Mitmproxy v4.0.3

I want to intercept the request from the client and send back a response without the upstream server ever being contacted. Everything works except the upstream server is always contacted with the original request.

I’ve created an add-on that has a request() method which:

- Creates a http.HTTPResponse object
- Assigns it to flow.response

Mitmproxy is being run with upstream\_cert=false.

How do I prevent Mitmproxy from ever fulfilling the original request?

Thanks for your help!
