mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 10:16:27 +00:00
Client playback shortcut in mitmproxy can now be used to interrupt a current client playback.
This commit is contained in:
parent
4893e5e5a4
commit
f97c144869
@ -1298,11 +1298,22 @@ class ConsoleMaster(flow.FlowMaster):
|
||||
if k == "?":
|
||||
self.view_help()
|
||||
elif k == "c":
|
||||
self.path_prompt(
|
||||
"Client replay: ",
|
||||
self.state.last_saveload,
|
||||
self.client_playback_path
|
||||
)
|
||||
if not self.client_playback:
|
||||
self.path_prompt(
|
||||
"Client replay: ",
|
||||
self.state.last_saveload,
|
||||
self.client_playback_path
|
||||
)
|
||||
else:
|
||||
self.prompt_onekey(
|
||||
"Stop current client replay?",
|
||||
(
|
||||
("yes", "y"),
|
||||
("no", "n"),
|
||||
),
|
||||
self.stop_client_playback_prompt,
|
||||
)
|
||||
|
||||
k = None
|
||||
elif k == "l":
|
||||
self.prompt("Limit: ", self.state.limit_txt, self.set_limit)
|
||||
@ -1384,6 +1395,10 @@ class ConsoleMaster(flow.FlowMaster):
|
||||
except (Stop, KeyboardInterrupt):
|
||||
pass
|
||||
|
||||
def stop_client_playback_prompt(self, a):
|
||||
if a != "n":
|
||||
self.stop_client_playback()
|
||||
|
||||
def quit(self, a):
|
||||
if a != "n":
|
||||
raise Stop
|
||||
|
@ -464,6 +464,9 @@ class FlowMaster(controller.Master):
|
||||
"""
|
||||
self.client_playback = ClientPlaybackState(flows, exit)
|
||||
|
||||
def stop_client_playback(self):
|
||||
self.client_playback = None
|
||||
|
||||
def start_server_playback(self, flows, kill, headers, exit):
|
||||
"""
|
||||
flows: A list of flows.
|
||||
|
Loading…
Reference in New Issue
Block a user