aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/complex/dns_spoofing.py6
-rw-r--r--examples/simple/custom_contentview.py2
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/complex/dns_spoofing.py b/examples/complex/dns_spoofing.py
index 1fb59f74..acda303d 100644
--- a/examples/complex/dns_spoofing.py
+++ b/examples/complex/dns_spoofing.py
@@ -1,5 +1,5 @@
"""
-This inline scripts makes it possible to use mitmproxy in scenarios where IP spoofing has been used to redirect
+This script makes it possible to use mitmproxy in scenarios where IP spoofing has been used to redirect
connections to mitmproxy. The way this works is that we rely on either the TLS Server Name Indication (SNI) or the
Host header of the HTTP request.
Of course, this is not foolproof - if an HTTPS connection comes without SNI, we don't
@@ -34,7 +34,7 @@ class Rerouter:
The original host header is retrieved early
before flow.request is replaced by mitmproxy new outgoing request
"""
- flow.metadata["original_host"] = flow.request.headers["Host"]
+ flow.metadata["original_host"] = flow.request.host_header
def request(self, flow):
if flow.client_conn.ssl_established:
@@ -53,7 +53,7 @@ class Rerouter:
if m.group("port"):
port = int(m.group("port"))
- flow.request.headers["Host"] = host_header
+ flow.request.host_header = host_header
flow.request.host = sni or host_header
flow.request.port = port
diff --git a/examples/simple/custom_contentview.py b/examples/simple/custom_contentview.py
index 35216397..1f3a38ec 100644
--- a/examples/simple/custom_contentview.py
+++ b/examples/simple/custom_contentview.py
@@ -10,7 +10,7 @@ class ViewSwapCase(contentviews.View):
# We don't have a good solution for the keyboard shortcut yet -
# you manually need to find a free letter. Contributions welcome :)
- prompt = ("swap case text", "p")
+ prompt = ("swap case text", "z")
content_types = ["text/plain"]
def __call__(self, data: bytes, **metadata):