mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 15:37:45 +00:00
fix #443
This commit is contained in:
parent
812ea90dc5
commit
8af26bd0b7
@ -823,8 +823,8 @@ class ConsoleMaster(flow.FlowMaster):
|
||||
if changed:
|
||||
self.statusbar.redraw()
|
||||
size = self.drawscreen()
|
||||
changed = self.tick(self.masterq, 0.01)
|
||||
self.ui.set_input_timeouts(max_wait=0.01)
|
||||
changed = self.tick(self.masterq, timeout=0.1)
|
||||
self.ui.set_input_timeouts(max_wait=0)
|
||||
keys = self.ui.get_input()
|
||||
if keys:
|
||||
changed = True
|
||||
|
@ -108,7 +108,7 @@ class Master(object):
|
||||
self.should_exit.clear()
|
||||
self.server.start_slave(Slave, Channel(self.masterq, self.should_exit))
|
||||
while not self.should_exit.is_set():
|
||||
self.tick(self.masterq, 0.01)
|
||||
self.tick(self.masterq, 0.1)
|
||||
self.shutdown()
|
||||
|
||||
def handle(self, mtype, obj):
|
||||
|
@ -758,7 +758,7 @@ class FlowMaster(controller.Master):
|
||||
self.shutdown()
|
||||
self.client_playback.tick(self)
|
||||
|
||||
return controller.Master.tick(self, q, timeout)
|
||||
return super(FlowMaster, self).tick(q, timeout)
|
||||
|
||||
def duplicate_flow(self, f):
|
||||
return self.load_flow(f.copy())
|
||||
|
24
test/tools/bench.py
Normal file
24
test/tools/bench.py
Normal file
@ -0,0 +1,24 @@
|
||||
from __future__ import print_function
|
||||
import requests, time
|
||||
|
||||
n = 100
|
||||
url = "http://192.168.1.1/"
|
||||
proxy = "http://192.168.1.115:8080/"
|
||||
|
||||
start = time.time()
|
||||
for _ in range(n):
|
||||
requests.get(url, allow_redirects=False, proxies=dict(http=proxy))
|
||||
print(".", end="")
|
||||
t_mitmproxy = time.time()-start
|
||||
|
||||
print("\r\nTotal time with mitmproxy: {}".format(t_mitmproxy))
|
||||
|
||||
|
||||
|
||||
start = time.time()
|
||||
for _ in range(n):
|
||||
requests.get(url, allow_redirects=False)
|
||||
print(".", end="")
|
||||
t_without = time.time()-start
|
||||
|
||||
print("\r\nTotal time without mitmproxy: {}".format(t_without))
|
Loading…
Reference in New Issue
Block a user