diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2018-02-24 14:39:03 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2018-02-24 14:39:03 +1300 |
commit | a12d1492308f281ae599f1142104eb62d924f3f1 (patch) | |
tree | 2e29af1df9cf47ffdb289b6a41de9aa92c1c5112 /mitmproxy | |
parent | 42094b29ff5e042b3cf3c2544fc7a60555cd3c26 (diff) | |
download | mitmproxy-a12d1492308f281ae599f1142104eb62d924f3f1.tar.gz mitmproxy-a12d1492308f281ae599f1142104eb62d924f3f1.tar.bz2 mitmproxy-a12d1492308f281ae599f1142104eb62d924f3f1.zip |
client options: migrate allowremote and clientplayback
Also triage options, and categorize them into core options (won't be migrated),
options that are hard to migrate for various reasons, and easy migrations.
Diffstat (limited to 'mitmproxy')
-rw-r--r-- | mitmproxy/addons/clientplayback.py | 6 | ||||
-rw-r--r-- | mitmproxy/options.py | 62 |
2 files changed, 34 insertions, 34 deletions
diff --git a/mitmproxy/addons/clientplayback.py b/mitmproxy/addons/clientplayback.py index 2dd488b9..a017ec0f 100644 --- a/mitmproxy/addons/clientplayback.py +++ b/mitmproxy/addons/clientplayback.py @@ -14,6 +14,12 @@ class ClientPlayback: self.current_thread = None self.configured = False + def load(self, loader): + loader.add_option( + "client_replay", typing.Sequence[str], [], + "Replay client requests from a saved file." + ) + def count(self) -> int: if self.current_thread: current = 1 diff --git a/mitmproxy/options.py b/mitmproxy/options.py index f31b4a03..ff13c385 100644 --- a/mitmproxy/options.py +++ b/mitmproxy/options.py @@ -30,77 +30,75 @@ class Options(optmanager.OptManager): # This provides type hints for IDEs (e.g. PyCharm) and mypy. # Autogenerated using test/helper_tools/typehints_for_options.py add_upstream_certs_to_client_chain = None # type: bool - allow_remote = None # type: bool body_size_limit = None # type: Optional[str] cadir = None # type: str certs = None # type: Sequence[str] ciphers_client = None # type: Optional[str] ciphers_server = None # type: Optional[str] client_certs = None # type: Optional[str] - client_replay = None # type: Sequence[str] - console_focus_follow = None # type: bool - console_layout = None # type: str - console_layout_headers = None # type: bool - console_mouse = None # type: bool - console_palette = None # type: str - console_palette_transparent = None # type: bool - default_contentview = None # type: str - flow_detail = None # type: int http2 = None # type: bool http2_priority = None # type: bool ignore_hosts = None # type: Sequence[str] - intercept = None # type: Optional[str] - intercept_active = None # type: bool keep_host_header = None # type: bool - keepserving = None # type: bool listen_host = None # type: str listen_port = None # type: int mode = None # type: str + rawtcp = None # type: bool + server = None # type: bool + spoof_source_address = None # type: bool + ssl_insecure = None # type: bool + ssl_verify_upstream_trusted_ca = None # type: Optional[str] + ssl_verify_upstream_trusted_cadir = None # type: Optional[str] + ssl_version_client = None # type: str + ssl_version_server = None # type: str + tcp_hosts = None # type: Sequence[str] + upstream_bind_address = None # type: str + upstream_cert = None # type: bool + websocket = None # type: bool + + # FIXME: Options that must be migrated to addons, but are complicated + # because they're used by more than one addon, or because they're + # embedded in the core code somehow. + default_contentview = None # type: str + flow_detail = None # type: int + intercept = None # type: Optional[str] + intercept_active = None # type: bool + proxyauth = None # type: Optional[str] + showhost = None # type: bool + verbosity = None # type: str + view_filter = None # type: Optional[str] + + # FIXME: Options that should be uncomplicated to migrate to addons + keepserving = None # type: bool onboarding = None # type: bool onboarding_host = None # type: str onboarding_port = None # type: int - proxyauth = None # type: Optional[str] - rawtcp = None # type: bool server_replay_refresh = None # type: bool replacements = None # type: Sequence[str] - server_replay_kill_extra = None # type: bool rfile = None # type: Optional[str] save_stream_file = None # type: Optional[str] save_stream_filter = None # type: Optional[str] scripts = None # type: Sequence[str] - server = None # type: bool server_replay = None # type: Sequence[str] server_replay_ignore_content = None # type: bool server_replay_ignore_host = None # type: bool server_replay_ignore_params = None # type: Sequence[str] server_replay_ignore_payload_params = None # type: Sequence[str] + server_replay_kill_extra = None # type: bool server_replay_nopop = None # type: bool server_replay_use_headers = None # type: Sequence[str] setheaders = None # type: Sequence[str] - showhost = None # type: bool - spoof_source_address = None # type: bool - ssl_insecure = None # type: bool - ssl_verify_upstream_trusted_ca = None # type: Optional[str] - ssl_verify_upstream_trusted_cadir = None # type: Optional[str] - ssl_version_client = None # type: str - ssl_version_server = None # type: str stickyauth = None # type: Optional[str] stickycookie = None # type: Optional[str] stream_large_bodies = None # type: Optional[str] stream_websockets = None # type: bool - tcp_hosts = None # type: Sequence[str] upstream_auth = None # type: Optional[str] - upstream_bind_address = None # type: str - upstream_cert = None # type: bool - verbosity = None # type: str - view_filter = None # type: Optional[str] view_order = None # type: str view_order_reversed = None # type: bool web_debug = None # type: bool web_iface = None # type: str web_open_browser = None # type: bool web_port = None # type: int - websocket = None # type: bool def __init__(self, **kwargs) -> None: super().__init__() @@ -120,10 +118,6 @@ class Options(optmanager.OptManager): "Port to serve the onboarding app from." ) self.add_option( - "client_replay", Sequence[str], [], - "Replay client requests from a saved file." - ) - self.add_option( "server_replay_kill_extra", bool, False, "Kill extra requests during replay." ) |