aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/flow.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2014-09-08 14:43:05 +0200
committerMaximilian Hils <git@maximilianhils.com>2014-09-08 14:43:32 +0200
commitece15b3c8af790e425ebcaa6807d6e133d810ff6 (patch)
tree25b238db6e1ecd01fb892efca3b2011d6289ad08 /libmproxy/flow.py
parentd06b4bfa4e4cc51e903b49e246d7771726a3e3a4 (diff)
downloadmitmproxy-ece15b3c8af790e425ebcaa6807d6e133d810ff6.tar.gz
mitmproxy-ece15b3c8af790e425ebcaa6807d6e133d810ff6.tar.bz2
mitmproxy-ece15b3c8af790e425ebcaa6807d6e133d810ff6.zip
reverse proxy: adjust dst when reading flows, fix #346
Diffstat (limited to 'libmproxy/flow.py')
-rw-r--r--libmproxy/flow.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/libmproxy/flow.py b/libmproxy/flow.py
index d263ccdd..6aa26f4a 100644
--- a/libmproxy/flow.py
+++ b/libmproxy/flow.py
@@ -615,6 +615,11 @@ class FlowMaster(controller.Master):
"""
Loads a flow, and returns a new flow object.
"""
+
+ if self.server and self.server.config.mode == "reverse":
+ f.request.host, f.request.port = self.server.config.mode.dst[2:]
+ f.request.scheme = "https" if self.server.config.mode.dst[1] else "http"
+
f.reply = controller.DummyReply()
if f.request:
self.handle_request(f)