Is there a way to get the access log programatically? #910
-
Hey, I want to test my code when going through a proxy. Is there a way to get all of the requests that went through the proxy as a python list/object? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Yes, you can get access to the logs programmatically. You need to write a plugin for it. Example, Also look at formal definition of proxy.py/proxy/http/proxy/plugin.py Lines 166 to 178 in d4449b8 Once you have a plugin with custom Let me know how it goes for you. |
Beta Was this translation helpful? Give feedback.
Yes, you can get access to the logs programmatically. You need to write a plugin for it. Example,
ProxyPoolPlugin
utilizeson_access_log
hook, see https://github.com/abhinavsingh/proxy.py/blob/develop/proxy/plugin/proxy_pool.py#L198-L212Also look at formal definition of
on_access_log
hereproxy.py/proxy/http/proxy/plugin.py
Lines 166 to 178 in d4449b8