mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 10:16:27 +00:00
f90b4c2ff0
Many addons currently save options on configure(), either as individual options or sometimes by saving the entire options object. The current options should simply be available on the ctx object, simplifying state management for addons considerably.
18 lines
444 B
Python
18 lines
444 B
Python
from mitmproxy import ctx
|
|
from mitmproxy.utils import human
|
|
|
|
"""
|
|
A tiny addon to print the proxy status to terminal. Eventually this could
|
|
also print some stats on exit.
|
|
"""
|
|
|
|
|
|
class TermStatus:
|
|
def running(self):
|
|
if ctx.options.server:
|
|
ctx.log.info(
|
|
"Proxy server listening at http://{}".format(
|
|
human.format_address(ctx.master.server.address)
|
|
)
|
|
)
|