aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2011-08-02 14:17:15 +1200
committerAldo Cortesi <aldo@nullcube.com>2011-08-02 14:17:15 +1200
commitf3f8462ddc7cc6cd4f708538457091d079eb9ff2 (patch)
treed7aacb2d312799780190f47bfb121058b5d225b4 /libmproxy
parent73a7d893e3f0805381651dddd29eb7d689f81c4f (diff)
downloadmitmproxy-f3f8462ddc7cc6cd4f708538457091d079eb9ff2.tar.gz
mitmproxy-f3f8462ddc7cc6cd4f708538457091d079eb9ff2.tar.bz2
mitmproxy-f3f8462ddc7cc6cd4f708538457091d079eb9ff2.zip
Make the mitmproxy eventlog display useful information.
Diffstat (limited to 'libmproxy')
-rw-r--r--libmproxy/console.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/libmproxy/console.py b/libmproxy/console.py
index bf86f187..2762c408 100644
--- a/libmproxy/console.py
+++ b/libmproxy/console.py
@@ -21,7 +21,7 @@ import urwid
import controller, utils, filt, proxy, flow, encoding
VIEW_CUTOFF = 1024*100
-EVENTLOG_SIZE = 100
+EVENTLOG_SIZE = 500
class Stop(Exception): pass
@@ -1764,11 +1764,21 @@ class ConsoleMaster(flow.FlowMaster):
# Handlers
def handle_clientconnect(self, r):
- self.add_event(urwid.Text("connect"))
+ self.add_event(urwid.Text("Connect from: %s:%s"%r.address))
return flow.FlowMaster.handle_clientconnect(self, r)
def handle_clientdisconnect(self, r):
- self.add_event(urwid.Text("disconnect"))
+ s = "Disconnect from: %s:%s"%r.client_conn.address
+ self.add_event(urwid.Text(s))
+ if r.client_conn.requestcount:
+ s = " -> handled %s requests"%r.client_conn.requestcount
+ self.add_event(urwid.Text(s))
+ if r.client_conn.connection_error:
+ self.add_event(
+ urwid.Text(
+ ("error", " -> error: %s"%r.client_conn.connection_error)
+ )
+ )
return flow.FlowMaster.handle_clientdisconnect(self, r)
def handle_error(self, r):