mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-29 11:03:13 +00:00
Add tornado dependency, serve index file
This commit is contained in:
parent
6812d304a1
commit
ff09529ba3
@ -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
|
||||
|
@ -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"),
|
||||
|
16
libmproxy/web/templates/index.html
Normal file
16
libmproxy/web/templates/index.html
Normal file
@ -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>
|
Loading…
Reference in New Issue
Block a user