From 85b5709ea5ce50423713e6847ee8cefb6001eee9 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Tue, 18 Oct 2022 09:31:56 +0200 Subject: [proxy] only listen on address 127.0.0.1 by default --- src/hydrilla/mitmproxy_launcher/launch.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/hydrilla/mitmproxy_launcher/launch.py b/src/hydrilla/mitmproxy_launcher/launch.py index e0c559b..82766b9 100644 --- a/src/hydrilla/mitmproxy_launcher/launch.py +++ b/src/hydrilla/mitmproxy_launcher/launch.py @@ -50,6 +50,8 @@ addons = [HaketiloAddon()] ''' @click.command(help=_('cli_help.haketilo')) +@click.option('-l', '--listen-host', default='127.0.0.1', type=click.STRING, + help=_('cli_opt.haketilo.listen_host')) @click.option('-p', '--port', default=8080, type=click.IntRange(1, 65535), help=_('cli_opt.haketilo.port')) @click.option('-d', '--directory', default='~/.haketilo/', @@ -58,10 +60,7 @@ addons = [HaketiloAddon()] @click.version_option(version=_version.version, prog_name='Haketilo proxy', message=_('%(prog)s_%(version)s_license'), help=_('cli_opt.haketilo.version')) -def launch(port: int, directory: str): - """ - .... - """ +def launch(listen_host: str, port: int, directory: str): directory_path = Path(os.path.expanduser(directory)).resolve() directory_path.mkdir(parents=True, exist_ok=True) @@ -72,6 +71,7 @@ def launch(port: int, directory: str): sys.argv = [ 'mitmdump', + '--listen-host', listen_host, '-p', str(port), '--set', f'confdir={directory_path / "mitmproxy"}', '--set', 'upstream_cert=false', -- cgit v1.2.3