aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/protocol
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2014-02-09 02:54:07 +0100
committerMaximilian Hils <git@maximilianhils.com>2014-02-09 02:54:07 +0100
commitd9a60372997fad5d7b94abaa49c5fb73e634a208 (patch)
treedc92d50e9cc7d5f0f0e2ba8117c0f9f0aaa1bea5 /libmproxy/protocol
parenta85974eaa88e1f63fda72e3df7a0ec3a0216a8e4 (diff)
downloadmitmproxy-d9a60372997fad5d7b94abaa49c5fb73e634a208.tar.gz
mitmproxy-d9a60372997fad5d7b94abaa49c5fb73e634a208.tar.bz2
mitmproxy-d9a60372997fad5d7b94abaa49c5fb73e634a208.zip
fix comments
Diffstat (limited to 'libmproxy/protocol')
-rw-r--r--libmproxy/protocol/http.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py
index e91e865a..bddd87df 100644
--- a/libmproxy/protocol/http.py
+++ b/libmproxy/protocol/http.py
@@ -975,6 +975,12 @@ class HTTPHandler(ProtocolHandler, TemporaryServerChangeMixin):
self.c.client_conn.wfile.flush()
def hook_reconnect(self, upstream_request):
+ """
+ If the authority request has been forwarded upstream (because we have another proxy server there),
+ money-patch the ConnectionHandler.server_reconnect function to resend the CONNECT request on reconnect.
+ Hooking code isn't particulary beautiful, but it isolates this edge-case from
+ the protocol-agnostic ConnectionHandler
+ """
self.c.log("Hook reconnect function")
original_reconnect_func = self.c.server_reconnect
@@ -997,11 +1003,6 @@ class HTTPHandler(ProtocolHandler, TemporaryServerChangeMixin):
def ssl_upgrade(self):
"""
Upgrade the connection to SSL after an authority (CONNECT) request has been made.
- If the authority request has been forwarded upstream (because we have another proxy server there),
- money-patch the ConnectionHandler.server_reconnect function to resend the request on reconnect.
-
- This isn't particular beautiful code, but it isolates this rare edge-case from the
- protocol-agnostic ConnectionHandler
"""
self.c.log("Received CONNECT request. Upgrading to SSL...")
self.c.mode = "transparent"