proxy.common.flag module#

proxy.py#

⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on Network monitoring, controls & Application development, testing, debugging.

copyright
  1. 2013-present by Abhinav Singh and contributors.

license

BSD, see LICENSE for more details.

class proxy.common.flag.FlagParser[source]#

Bases: object

Wrapper around argparse module.

Import flag.flags and use add_argument API to define custom flags within respective Python files.

Best Practice:

1. Define flags at the top of your class files.
2. DO NOT add flags within your class `__init__` method OR
   within class methods.  It MAY result into runtime exception,
   especially if your class is initialized multiple times or if
   class method registering the flag gets invoked multiple times.
add_argument(*args: Any, **kwargs: Any) argparse.Action[source]#

Register a flag.

static get_default_plugins(args: argparse.Namespace) List[str][source]#

Prepare list of plugins to load based upon –enable-* and –disable-* flags.

static initialize(input_args: Optional[List[str]] = None, **opts: Any) argparse.Namespace[source]#
parse_args(input_args: Optional[List[str]]) argparse.Namespace[source]#

Parse flags from input arguments.