@@ -0,0 +1,659 @@
+from libmproxy.flow import Response%0Afrom netlib.odict import ODictCaseless%0A%0A%22%22%22%0AThis example shows two ways to redirect flows to other destinations.%0A%22%22%22%0A%0Adef request(context, flow):%0A    if flow.request.host.endswith(%22example.com%22):%0A        resp = Response(flow.request,%0A                        %5B1,1%5D,%0A                        200, %22OK%22,%0A                        ODictCaseless(%5B%5B%22Content-Type%22,%22text/html%22%5D%5D),%0A                        %22helloworld%22,%0A                        None)%0A        flow.request.reply(resp)%0A    if flow.request.host.endswith(%22example.org%22):%0A        flow.request.host = %22mitmproxy.org%22%0A        flow.request.headers%5B%22Host%22%5D = %5B%22mitmproxy.org%22%5D%0A

Add redirect example