From 24cf8da27eb56a65bf3e4ceb78bbeacdb1864597 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Wed, 19 Oct 2016 15:25:39 +1300 Subject: Move all tools into mitmproxy.tools, move models/* to top level The primary motivation here (and for all the other moving around) is to present a clean "front of house" to library users, and to migrate primary objects to the top of the module hierarchy. --- examples/redirect_requests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/redirect_requests.py') diff --git a/examples/redirect_requests.py b/examples/redirect_requests.py index bbb84e2f..c28042db 100644 --- a/examples/redirect_requests.py +++ b/examples/redirect_requests.py @@ -1,7 +1,7 @@ """ This example shows two ways to redirect flows to other destinations. """ -from mitmproxy.models import HTTPResponse +from mitmproxy import http def request(flow): @@ -11,7 +11,7 @@ def request(flow): # Method 1: Answer with a locally generated response if flow.request.pretty_host.endswith("example.com"): - flow.response = HTTPResponse.make(200, b"Hello World", {"Content-Type": "text/html"}) + flow.response = http.HTTPResponse.make(200, b"Hello World", {"Content-Type": "text/html"}) # Method 2: Redirect the request to a different server if flow.request.pretty_host.endswith("example.org"): -- cgit v1.2.3