MITMProxy如何删除流,使其不显示在MITMWeb中 [英] MITMProxy how to remove flows so they do not show up in MITMWeb
问题描述
我想使用MITMProxy Python脚本从Web界面中删除我发现无用的流。
I'd like to use MITMProxy Python scripting to remove flows that i find useless from the web interface.
让我说我杀死了一个流
def request(flow):
if("ads" in flow.request.url):
flow.kill()
但是我也想取消连接以使其不显示在我的MITMWeb界面中。
But also i would like killed connections to not show up in my MITMWeb interface.
可以在此处找到示例:
https://imgur.com/a/la0RDmh
An example can be found here: https://imgur.com/a/la0RDmh
我无法找到以编程方式从列表中删除请求的方法。
I am unable to find a way programatically to delete the requests from the list.
我只想看看通过它的连接。
I would only like to see the connections that make it through.
有什么想法吗?
推荐答案
使用过滤器
可以过滤掉这些请求,不会出现在界面中: https://docs.mitmproxy.org/stable/concepts- filter /
It's possible to filter out these requests and they won't appear in interface: https://docs.mitmproxy.org/stable/concepts-filters/
在这种情况下,通过应用过滤器:! googleadservices
In this case, by applying filter: ! googleadservices
使用ignore_hosts选项
使用选项 ignore_hosts
完全忽略这些请求。这些请求将绕过mitmproxy:
https://docs.mitmproxy.org/stable / concepts-options /
Or, using option ignore_hosts
to ignore these requests completely. These requests will bypass mitmproxy:
https://docs.mitmproxy.org/stable/concepts-options/
在这种情况下,通过在启动Web界面时应用选项: mitmweb --set ignore_hosts ='www .googleadservices.com'
In this case, by applying option when starting web interface: mitmweb --set ignore_hosts='www.googleadservices.com'
还可以在网络界面中编辑忽略主机:选项标签->编辑选项->找到忽略主机,然后修改它。
It's also possible to edit ignore hosts in web interface: Options tab -> Edit options -> find ignore hosts and modify it.
这篇关于MITMProxy如何删除流,使其不显示在MITMWeb中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!