[Plugin] Custom flags in external plugins not discovered when enabled using kwargs
abhinavsingh opened this issue · 2 comments
Describe the bug
DOES NOT WORK
proxy.Proxy(plugins=["...", "...",])
will not result in discovering custom flags defined in the external plugins.
FOLLOWING 2 SCENARIO WORKS
proxy.Plugin(*("--plugin", "...", "--plugin", "..."))
or
proxy --plugin ....
FIX
args.plugins
must be resolved prior to calling Flags.parse
for custom flag discovery.
Hi,
Is there any update to this or more details regarding implementing the workaround for the skeleton app example? https://github.com/abhinavsingh/proxy.py/tree/develop/skeleton
Hi,
Is there any update to this or more details regarding implementing the workaround for the skeleton app example? https://github.com/abhinavsingh/proxy.py/tree/develop/skeleton
Figured it out.
def run_proxy() -> None:
with proxy.Proxy(
enable_web_server=True,
port=9000,
input_args=["--plugin", "<plugin name>"]
) as _:
proxy.sleep_loop()
This then correctly loads the plugin and resolves the plugins flags and their default values. I would imagine for any utilisation of the flags (outside of default) you'd probably need to add those to the input_args
as well