I am currently creating an application which embeds proxy.py with a custom plugin.
Due to requiring custom flags within the custom plugin I am having to use the workaround detailed in https://github.com/abhinavsingh/proxy.py/issues/871 in order for them to parse correctly.
I have noticed that since implementing this workaround that I am no longer getting any logs/stdout from the proxy.
Simplified version of my code below.
def run_proxy() -> None:
proxy_py_args = [
"--plugin", "<my plugin>",
"--disable-headers", "Via"
]
with proxy.Proxy(
port=9000,
input_args=proxy_py_args
) as p:
logging.info(f"starting proxy at {p.flags.hostname}:{p.flags.port}")
print(p.flags)
proxy.sleep_loop()
I do not see the message from logging.info in stdout. However, I do see the print. I have tried specifying a log-file which seems to parse correctly into p.flags but it does not get written to.
However, when I run the following I see the regular logging/stdout.
def run_proxy() -> None:
with proxy.Proxy(
port=9000,
plugins=["<plugin name>"]
) as _:
proxy.sleep_loop()
@klmunday Thanks for reporting, this needs little investigation. I don't think we have enough test coverage for custom plugin "flags", so this may have gone rogue. Give me some time, will look into it and #871
I am currently creating an application which embeds proxy.py with a custom plugin. Due to requiring custom flags within the custom plugin I am having to use the workaround detailed in https://github.com/abhinavsingh/proxy.py/issues/871 in order for them to parse correctly.
I have noticed that since implementing this workaround that I am no longer getting any logs/stdout from the proxy.
Simplified version of my code below.
I do not see the message from
logging.info
in stdout. However, I do see the print. I have tried specifying a log-file which seems to parse correctly into p.flags but it does not get written to.However, when I run the following I see the regular logging/stdout.
This however breaks the parsing of the custom plugins flags (as detailed in https://github.com/abhinavsingh/proxy.py/issues/871) so this is not a solution.
I have also tried using
proxy.main
instead, then specifying my args via command line but that has not worked.