diff options
Diffstat (limited to 'src/hydrilla/mitmproxy_launcher')
-rw-r--r-- | src/hydrilla/mitmproxy_launcher/__init__.py | 5 | ||||
-rw-r--r-- | src/hydrilla/mitmproxy_launcher/launch.py | 16 |
2 files changed, 14 insertions, 7 deletions
diff --git a/src/hydrilla/mitmproxy_launcher/__init__.py b/src/hydrilla/mitmproxy_launcher/__init__.py new file mode 100644 index 0000000..d382ead --- /dev/null +++ b/src/hydrilla/mitmproxy_launcher/__init__.py @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: CC0-1.0 + +# Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org> +# +# Available under the terms of Creative Commons Zero v1.0 Universal. diff --git a/src/hydrilla/mitmproxy_launcher/launch.py b/src/hydrilla/mitmproxy_launcher/launch.py index c826598..765a9ce 100644 --- a/src/hydrilla/mitmproxy_launcher/launch.py +++ b/src/hydrilla/mitmproxy_launcher/launch.py @@ -42,6 +42,12 @@ import click from .. import _version from ..translations import smart_gettext as _ +addon_script_text = ''' +from hydrilla.proxy.addon import HaketiloAddon + +addons = [HaketiloAddon()] +''' + @click.command(help=_('cli_help.haketilo')) @click.option('-p', '--port', default=8080, type=click.IntRange(0, 65535), help=_('cli_opt.haketilo.port')) @@ -61,17 +67,13 @@ def launch(port: int, directory: str): script_path = directory_path / 'addon.py' - script_path.write_text(''' -from hydrilla.mitmproxy_addon.addon import Haketilo - -addons = [Haketilo()] -''') + script_path.write_text(addon_script_text) code = sp.call(['mitmdump', '-p', str(port), - '--set', f'confdir={directory_path / "mitmproxy"}' + '--set', f'confdir={directory_path / "mitmproxy"}', '--set', 'upstream_cert=false', - '--set', f'haketilo_dir={directory_path}' + '--set', f'haketilo_dir={directory_path}', '--scripts', str(script_path)]) sys.exit(code) |