aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/proxy
diff options
context:
space:
mode:
authorAlexander Prinzhorn <alexander@prinzhorn.it>2020-04-02 11:18:38 +0200
committerAlexander Prinzhorn <alexander@prinzhorn.it>2020-04-02 11:18:38 +0200
commitca4b7a307f6f13d03879617434e734aa237d9cb1 (patch)
tree9f06fc53484554ef8f7489c3e7998329ab3c827f /mitmproxy/proxy
parent3046a628fd0b719ff587eac5f5fd6965cd5eac89 (diff)
downloadmitmproxy-ca4b7a307f6f13d03879617434e734aa237d9cb1.tar.gz
mitmproxy-ca4b7a307f6f13d03879617434e734aa237d9cb1.tar.bz2
mitmproxy-ca4b7a307f6f13d03879617434e734aa237d9cb1.zip
Only emit "serverconnect" after successfully connecting
Diffstat (limited to 'mitmproxy/proxy')
-rw-r--r--mitmproxy/proxy/protocol/base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mitmproxy/proxy/protocol/base.py b/mitmproxy/proxy/protocol/base.py
index 2063f901..3bf03521 100644
--- a/mitmproxy/proxy/protocol/base.py
+++ b/mitmproxy/proxy/protocol/base.py
@@ -160,10 +160,10 @@ class ServerConnectionMixin:
"""
if not self.server_conn.address:
raise exceptions.ProtocolException("Cannot connect to server, no server address given.")
- self.log("serverconnect", "debug", [repr(self.server_conn.address)])
- self.channel.ask("serverconnect", self.server_conn)
try:
self.server_conn.connect()
+ self.log("serverconnect", "debug", [repr(self.server_conn.address)])
+ self.channel.ask("serverconnect", self.server_conn)
except exceptions.TcpException as e:
raise exceptions.ProtocolException(
"Server connection to {} failed: {}".format(