diff --git a/core/cli_api.py b/core/cli_api.py index 734a4cf..b3450e4 100644 --- a/core/cli_api.py +++ b/core/cli_api.py @@ -157,6 +157,15 @@ def disable_hysteria2_obfs(): '''Removes 'obfs' from Hysteria2 configuration.''' run_cmd(['bash', Command.MANAGE_OBFS.value, '--remove']) + +def enable_hysteria2_masquerade(domain: str): + '''Enables masquerade for Hysteria2.''' + run_cmd(['bash', Command.MASQUERADE_SCRIPT.value, '1', domain]) + + +def disable_hysteria2_masquerade(): + '''Disables masquerade for Hysteria2.''' + run_cmd(['bash', Command.MASQUERADE_SCRIPT.value, '2']) # endregion # region User @@ -301,19 +310,6 @@ def update_geo(country: str): raise HysteriaError(f'An unexpected error occurred: {e}') -def masquerade(remove: bool, enable: str): - ''' - Configures masquerade settings. - ''' - if remove and enable: - raise InvalidInputError('Error: You cannot use both --remove and --enable at the same time.') - if remove: - run_cmd(['bash', Command.MASQUERADE_SCRIPT.value, '2']) - elif enable: - run_cmd(['bash', Command.MASQUERADE_SCRIPT.value, '1', enable]) - else: - raise InvalidInputError('Error: Please specify either --remove or --enable.') - # endregion # region Advanced Menu