【发布时间】:2021-07-08 20:21:12
【问题描述】:
我正在关注following 问题中的代码(转载如下):
def response(flow):
print("")
print("="*50)
print(flow.request.method + " " + flow.request.path + " " + flow.request.http_version)
print("-"*25 + " request headers " + "-"*25)
for k, v in flow.request.headers.items():
print("%-30s: %s" % (k.upper(), v))
print("-"*25 + " response headers " + "-"*25)
for k, v in flow.response.headers.items():
print("%-30s: %s" % (k.upper(), v))
print("-"*25 + " body (first 100 bytes) " + "-"*25)
print(flow.request.content[0:100])
我很难理解在使用 mitmproxy 时在哪里可以找到 flow 变量。如何连接 mitmproxy 以便接收请求流?
【问题讨论】:
标签: python python-requests mitmproxy man-in-the-middle