aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2018-04-02 15:00:13 +1200
committerAldo Cortesi <aldo@nullcube.com>2018-04-02 15:00:13 +1200
commit1f33c1c1a54e466f903cc69a2e086d699515cad8 (patch)
tree3e8eaa04c688f9c82b80bb5f31c853094576a08f
parenta3da43d3e5d5b2ca243971e586aeee4969b6d053 (diff)
downloadmitmproxy-1f33c1c1a54e466f903cc69a2e086d699515cad8.tar.gz
mitmproxy-1f33c1c1a54e466f903cc69a2e086d699515cad8.tar.bz2
mitmproxy-1f33c1c1a54e466f903cc69a2e086d699515cad8.zip
asyncio: rebase mitmweb Tornado event loop on asyncio
-rw-r--r--mitmproxy/tools/web/master.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mitmproxy/tools/web/master.py b/mitmproxy/tools/web/master.py
index 4c597f0e..843190e0 100644
--- a/mitmproxy/tools/web/master.py
+++ b/mitmproxy/tools/web/master.py
@@ -2,6 +2,9 @@ import webbrowser
import tornado.httpserver
import tornado.ioloop
+from tornado.platform.asyncio import AsyncIOMainLoop
+import asyncio
+
from mitmproxy import addons
from mitmproxy import log
from mitmproxy import master
@@ -102,6 +105,7 @@ class WebMaster(master.Master):
)
def run(self): # pragma: no cover
+ AsyncIOMainLoop().install()
iol = tornado.ioloop.IOLoop.instance()
@@ -109,7 +113,6 @@ class WebMaster(master.Master):
http_server.listen(self.options.web_port, self.options.web_iface)
iol.add_callback(self.start)
- tornado.ioloop.PeriodicCallback(lambda: self.tick(timeout=0), 5).start()
web_url = "http://{}:{}/".format(self.options.web_iface, self.options.web_port)
self.add_log(