mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 18:18:25 +00:00
Remove beep functionality from mitmproxy.
This acts funny (sometimes works, sometimes doesn't) and isn't really useful.
This commit is contained in:
parent
c901cbbada
commit
0042687f0d
@ -717,7 +717,6 @@ class ConsoleState(flow.State):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
flow.State.__init__(self)
|
flow.State.__init__(self)
|
||||||
self.focus = None
|
self.focus = None
|
||||||
self.beep = None
|
|
||||||
|
|
||||||
self.view_body_mode = VIEW_BODY_RAW
|
self.view_body_mode = VIEW_BODY_RAW
|
||||||
self.view_flow_mode = VIEW_FLOW_REQUEST
|
self.view_flow_mode = VIEW_FLOW_REQUEST
|
||||||
@ -778,7 +777,6 @@ class ConsoleState(flow.State):
|
|||||||
class Options(object):
|
class Options(object):
|
||||||
__slots__ = [
|
__slots__ = [
|
||||||
"anticache",
|
"anticache",
|
||||||
"beep",
|
|
||||||
"client_replay",
|
"client_replay",
|
||||||
"keepserving",
|
"keepserving",
|
||||||
"kill",
|
"kill",
|
||||||
@ -836,11 +834,6 @@ class ConsoleMaster(flow.FlowMaster):
|
|||||||
print >> sys.stderr, "Intercept error:", r
|
print >> sys.stderr, "Intercept error:", r
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
r = self.set_beep(options.beep)
|
|
||||||
if r:
|
|
||||||
print >> sys.stderr, "Beep error:", r
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
r = self.set_stickycookie(options.stickycookie)
|
r = self.set_stickycookie(options.stickycookie)
|
||||||
if r:
|
if r:
|
||||||
print >> sys.stderr, "Sticky cookies error:", r
|
print >> sys.stderr, "Sticky cookies error:", r
|
||||||
@ -1029,7 +1022,6 @@ class ConsoleMaster(flow.FlowMaster):
|
|||||||
keys = [
|
keys = [
|
||||||
("A", "accept all intercepted connections"),
|
("A", "accept all intercepted connections"),
|
||||||
("a", "accept this intercepted connection"),
|
("a", "accept this intercepted connection"),
|
||||||
("B", "set beep filter pattern"),
|
|
||||||
("c", "client replay"),
|
("c", "client replay"),
|
||||||
("i", "set interception pattern"),
|
("i", "set interception pattern"),
|
||||||
("j, k", "up, down"),
|
("j, k", "up, down"),
|
||||||
@ -1177,14 +1169,6 @@ class ConsoleMaster(flow.FlowMaster):
|
|||||||
def set_intercept(self, txt):
|
def set_intercept(self, txt):
|
||||||
return self.state.set_intercept(txt)
|
return self.state.set_intercept(txt)
|
||||||
|
|
||||||
def set_beep(self, txt):
|
|
||||||
if txt:
|
|
||||||
self.state.beep = filt.parse(txt)
|
|
||||||
if not self.state.beep:
|
|
||||||
return "Invalid filter expression."
|
|
||||||
else:
|
|
||||||
self.state.beep = None
|
|
||||||
|
|
||||||
def drawscreen(self):
|
def drawscreen(self):
|
||||||
size = self.ui.get_cols_rows()
|
size = self.ui.get_cols_rows()
|
||||||
canvas = self.view.render(size, focus=1)
|
canvas = self.view.render(size, focus=1)
|
||||||
@ -1233,9 +1217,6 @@ class ConsoleMaster(flow.FlowMaster):
|
|||||||
)
|
)
|
||||||
self.sync_list_view()
|
self.sync_list_view()
|
||||||
k = None
|
k = None
|
||||||
elif k == "B":
|
|
||||||
self.prompt("Beep: ", "", self.set_beep)
|
|
||||||
k = None
|
|
||||||
elif k == "j":
|
elif k == "j":
|
||||||
k = "down"
|
k = "down"
|
||||||
elif k == "k":
|
elif k == "k":
|
||||||
@ -1314,8 +1295,6 @@ class ConsoleMaster(flow.FlowMaster):
|
|||||||
self.statusbar.refresh_connection(c)
|
self.statusbar.refresh_connection(c)
|
||||||
|
|
||||||
def process_flow(self, f, r):
|
def process_flow(self, f, r):
|
||||||
if f.match(self.state.beep):
|
|
||||||
urwid.curses_display.curses.beep()
|
|
||||||
if f.match(self.state.intercept) and not f.request.is_replay():
|
if f.match(self.state.intercept) and not f.request.is_replay():
|
||||||
f.intercept()
|
f.intercept()
|
||||||
else:
|
else:
|
||||||
|
@ -34,11 +34,6 @@ if __name__ == '__main__':
|
|||||||
"Filters",
|
"Filters",
|
||||||
"See help in mitmproxy for filter expression syntax."
|
"See help in mitmproxy for filter expression syntax."
|
||||||
)
|
)
|
||||||
group.add_option(
|
|
||||||
"-B", "--beep", action="store",
|
|
||||||
type = "str", dest="beep", default=None,
|
|
||||||
help = "Beep filter expression."
|
|
||||||
)
|
|
||||||
group.add_option(
|
group.add_option(
|
||||||
"-l", "--limit", action="store",
|
"-l", "--limit", action="store",
|
||||||
type = "str", dest="limit", default=None,
|
type = "str", dest="limit", default=None,
|
||||||
|
Loading…
Reference in New Issue
Block a user