Update mitmproxy/README.md
This commit is contained in:
@@ -1,3 +1,21 @@
|
|||||||
|
# `dump.py`
|
||||||
|
```python
|
||||||
|
I = lambda module: __import__('importlib').import_module(module)
|
||||||
|
|
||||||
|
def request(flow):
|
||||||
|
with I('dbm.sqlite3').open('dbm.sql') as db:
|
||||||
|
if (url := flow.request.url) in db:
|
||||||
|
flow.response = I('mitmproxy.http').Response.make(200, db[url])
|
||||||
|
|
||||||
|
def response(flow):
|
||||||
|
if flow.response.status_code == 200:
|
||||||
|
with I('dbm.sqlite3').open('dbm.sql', 'c') as db:
|
||||||
|
db[flow.request.url] = flow.response.content
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
I('subprocess').run(['mitmdump', '-s', __file__])
|
||||||
|
```
|
||||||
|
|
||||||
# Retries if failed
|
# Retries if failed
|
||||||
```python
|
```python
|
||||||
def response(flow):
|
def response(flow):
|
||||||
|
|||||||
Reference in New Issue
Block a user