aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/web
diff options
context:
space:
mode:
Diffstat (limited to 'libmproxy/web')
-rw-r--r--libmproxy/web/__init__.py3
-rw-r--r--libmproxy/web/app.py6
-rw-r--r--libmproxy/web/templates/index.html16
3 files changed, 22 insertions, 3 deletions
diff --git a/libmproxy/web/__init__.py b/libmproxy/web/__init__.py
index 99b190aa..8f98060c 100644
--- a/libmproxy/web/__init__.py
+++ b/libmproxy/web/__init__.py
@@ -82,20 +82,17 @@ class WebMaster(flow.FlowMaster):
self.shutdown()
def handle_request(self, f):
- print "req"
flow.FlowMaster.handle_request(self, f)
if f:
f.reply()
return f
def handle_response(self, f):
- print "resp"
flow.FlowMaster.handle_response(self, f)
if f:
f.reply()
return f
def handle_error(self, f):
- print "err"
flow.FlowMaster.handle_error(self, f)
return f
diff --git a/libmproxy/web/app.py b/libmproxy/web/app.py
index 7c26c29d..31b299a3 100644
--- a/libmproxy/web/app.py
+++ b/libmproxy/web/app.py
@@ -3,9 +3,15 @@ import os.path
import tornado.web
+class IndexHandler(tornado.web.RequestHandler):
+ def get(self):
+ self.render("index.html")
+
+
class Application(tornado.web.Application):
def __init__(self, debug):
handlers = [
+ (r"/", IndexHandler),
]
settings = dict(
template_path=os.path.join(os.path.dirname(__file__), "templates"),
diff --git a/libmproxy/web/templates/index.html b/libmproxy/web/templates/index.html
new file mode 100644
index 00000000..434f15f9
--- /dev/null
+++ b/libmproxy/web/templates/index.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head lang="en">
+ <meta charset="UTF-8">
+ <title>mitmproxy</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <link rel="stylesheet" href="static/mitmproxy.css"/>
+ <script src="static/mitmproxy.js"></script>
+</head>
+<body>
+<div id="mitmproxy"></div>
+</body>
+<script>
+ app = React.renderComponent(routes, document.body);
+</script>
+</html> \ No newline at end of file