Skip to content

Commit

Permalink
[web] show proxy address, add websocket toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
mhils committed Dec 11, 2016
1 parent 4023327 commit b92980e
Show file tree
Hide file tree
Showing 8 changed files with 58,417 additions and 522 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
@@ -1,2 +1,2 @@
mitmproxy/web/static/**/* -diff
mitmproxy/tools/web/static/**/* -diff
web/src/js/filt/filt.js -diff
7 changes: 5 additions & 2 deletions mitmproxy/tools/web/app.py
Expand Up @@ -376,19 +376,22 @@ def get(self):
no_upstream_cert=self.master.options.no_upstream_cert,
rawtcp=self.master.options.rawtcp,
http2=self.master.options.http2,
websocket=self.master.options.websocket,
anticache=self.master.options.anticache,
anticomp=self.master.options.anticomp,
stickyauth=self.master.options.stickyauth,
stickycookie=self.master.options.stickycookie,
stream=self.master.options.stream_large_bodies,
contentViews=[v.name.replace(' ', '_') for v in contentviews.views]
contentViews=[v.name.replace(' ', '_') for v in contentviews.views],
listen_host=self.master.options.listen_host,
listen_port=self.master.options.listen_port,
))

def put(self):
update = self.json
option_whitelist = {
"intercept", "showhost", "no_upstream_cert",
"rawtcp", "http2", "anticache", "anticomp",
"rawtcp", "http2", "websocket", "anticache", "anticomp",
"stickycookie", "stickyauth", "stream_large_bodies"
}
for k in update:
Expand Down
1 change: 1 addition & 0 deletions mitmproxy/tools/web/master.py
Expand Up @@ -10,6 +10,7 @@
from mitmproxy.addons import intercept
from mitmproxy.addons import termlog
from mitmproxy.addons import view
from mitmproxy.options import Options # noqa
from mitmproxy.tools.web import app


Expand Down
856 changes: 855 additions & 1 deletion mitmproxy/tools/web/static/app.css

Large diffs are not rendered by default.

8,620 changes: 8,503 additions & 117 deletions mitmproxy/tools/web/static/app.js

Large diffs are not rendered by default.

49,434 changes: 49,036 additions & 398 deletions mitmproxy/tools/web/static/vendor.js

Large diffs are not rendered by default.

15 changes: 12 additions & 3 deletions web/src/js/components/Footer.jsx
Expand Up @@ -7,7 +7,8 @@ Footer.propTypes = {
}

function Footer({ settings }) {
let {mode, intercept, showhost, no_upstream_cert, rawtcp, http2, anticache, anticomp, stickyauth, stickycookie, stream_large_bodies} = settings;
let {mode, intercept, showhost, no_upstream_cert, rawtcp, http2, websocket, anticache, anticomp,
stickyauth, stickycookie, stream_large_bodies, listen_host, listen_port} = settings;
return (
<footer>
{mode && mode != "regular" && (
Expand All @@ -25,8 +26,11 @@ function Footer({ settings }) {
{rawtcp && (
<span className="label label-success">raw-tcp</span>
)}
{!http2 && (
<span className="label label-success">no-http2</span>
{http2 && (
<span className="label label-success">http2</span>
)}
{!websocket && (
<span className="label label-success">no-websocket</span>
)}
{anticache && (
<span className="label label-success">anticache</span>
Expand All @@ -43,6 +47,11 @@ function Footer({ settings }) {
{stream_large_bodies && (
<span className="label label-success">stream: {formatSize(stream_large_bodies)}</span>
)}
<div className="pull-right">
<span className="label label-primary" title="HTTP Proxy Server Address">
[{listen_host || "*"}:{listen_port}]
</span>
</div>
</footer>
)
}
Expand Down
4 changes: 4 additions & 0 deletions web/src/js/components/Header/OptionMenu.jsx
Expand Up @@ -31,6 +31,10 @@ function OptionMenu({ settings, updateSettings }) {
checked={settings.http2}
onToggle={() => updateSettings({ http2: !settings.http2 })}
/>
<ToggleButton text="websocket"
checked={settings.websocket}
onToggle={() => updateSettings({ websocket: !settings.websocket })}
/>
<ToggleButton text="anticache"
checked={settings.anticache}
onToggle={() => updateSettings({ anticache: !settings.anticache })}
Expand Down

0 comments on commit b92980e

Please sign in to comment.