mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 02:24:18 +00:00
console: add a -l flag to set the limit on startup
This commit is contained in:
parent
5ff4303124
commit
850a50262b
@ -599,6 +599,11 @@ def mitmproxy():
|
|||||||
type=str, dest="intercept", default=None,
|
type=str, dest="intercept", default=None,
|
||||||
help="Intercept filter expression."
|
help="Intercept filter expression."
|
||||||
)
|
)
|
||||||
|
group.add_argument(
|
||||||
|
"-l", "--limit", action="store",
|
||||||
|
type=str, dest="limit", default=None,
|
||||||
|
help="Limit filter expression."
|
||||||
|
)
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|
||||||
|
@ -116,6 +116,7 @@ class Options(object):
|
|||||||
"keepserving",
|
"keepserving",
|
||||||
"kill",
|
"kill",
|
||||||
"intercept",
|
"intercept",
|
||||||
|
"limit",
|
||||||
"no_server",
|
"no_server",
|
||||||
"refresh_server_playback",
|
"refresh_server_playback",
|
||||||
"rfile",
|
"rfile",
|
||||||
@ -162,6 +163,9 @@ class ConsoleMaster(flow.FlowMaster):
|
|||||||
print >> sys.stderr, "Intercept error:", r
|
print >> sys.stderr, "Intercept error:", r
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
if options.limit:
|
||||||
|
self.set_limit(options.limit)
|
||||||
|
|
||||||
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
|
||||||
|
@ -549,3 +549,9 @@ class CookieEditor(GridEditor):
|
|||||||
title = "Editing request Cookie header"
|
title = "Editing request Cookie header"
|
||||||
columns = 2
|
columns = 2
|
||||||
headings = ("Name", "Value")
|
headings = ("Name", "Value")
|
||||||
|
|
||||||
|
|
||||||
|
class SetCookieEditor(GridEditor):
|
||||||
|
title = "Editing request SetCookie header"
|
||||||
|
columns = 2
|
||||||
|
headings = ("Name", "Value")
|
||||||
|
@ -92,6 +92,7 @@ def mitmproxy(args=None): # pragma: nocover
|
|||||||
console_options.palette_transparent = options.palette_transparent
|
console_options.palette_transparent = options.palette_transparent
|
||||||
console_options.eventlog = options.eventlog
|
console_options.eventlog = options.eventlog
|
||||||
console_options.intercept = options.intercept
|
console_options.intercept = options.intercept
|
||||||
|
console_options.limit = options.limit
|
||||||
|
|
||||||
server = get_server(console_options.no_server, proxy_config)
|
server = get_server(console_options.no_server, proxy_config)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user