# Decrypt Traffic Route to Squid then Encrypt Back?

**URL:** <https://discourse.mitmproxy.org/t/decrypt-traffic-route-to-squid-then-encrypt-back/427>\
**Category:** Uncategorized\
**Created:** [March 31, 2017, 8:14am UTC](https://discourse.mitmproxy.org/t/decrypt-traffic-route-to-squid-then-encrypt-back/427 "2017-03-31T08:14:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ziad\_kiwan](https://avatars.discourse-cdn.com/v4/letter/z/6bbea6/32.png) [@ziad\_kiwan](https://discourse.mitmproxy.org/u/ziad_kiwan)\
**Post date:** [March 31, 2017, 8:14am UTC](https://discourse.mitmproxy.org/t/decrypt-traffic-route-to-squid-then-encrypt-back/427/1 "2017-03-31T08:14:37Z")

</div>

Hello i’m working on a project to cache HTTPS connection via squid server, so i’m wondering if i can route the decrypted HTTPS traffic to squid server so he logs it then i route back the traffic from squid server to mitm server to encrypt it back and send it to facebook/google Graph:

Internet \<—\> MITMPROXY \<====\> Squid Server \<====\> MITMPROXY \<----\> User.

Thank you! if you got another suggestion please tell me!

---

<div class="post-metadata">

**Author:** ![jfmherokiller](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mitmproxy.org/jfmherokiller/32/146_2.png) [@jfmherokiller](https://discourse.mitmproxy.org/u/jfmherokiller)\
**Post date:** [April 5, 2017, 3:17pm UTC](https://discourse.mitmproxy.org/t/decrypt-traffic-route-to-squid-then-encrypt-back/427/2 "2017-04-05T15:17:45Z")

</div>

im not sure how you would go about doing this but you might wish to look at this file for ideas [https://github.com/mitmproxy/mitmproxy/blob/master/examples/simple/redirect\_requests.py](https://github.com/mitmproxy/mitmproxy/blob/master/examples/simple/redirect_requests.py)
