mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
Update README.md
This commit is contained in:
parent
8b1f3b2da3
commit
72050ab0e4
@ -109,8 +109,9 @@ Method Overloading
|
|||||||
------------------
|
------------------
|
||||||
|
|
||||||
The alternate approach to extending the proxy functionality is to subclass the ProxyHandler class and overload the
|
The alternate approach to extending the proxy functionality is to subclass the ProxyHandler class and overload the
|
||||||
mitm_request and mitm_response methods. The following is a quick example:
|
```mitm_request``` and ```mitm_response``` methods. The following is a quick example:
|
||||||
|
|
||||||
|
```python
|
||||||
from miproxy.proxy import AsyncMitmProxy
|
from miproxy.proxy import AsyncMitmProxy
|
||||||
|
|
||||||
class MitmProxyHandler(ProxyHandler):
|
class MitmProxyHandler(ProxyHandler):
|
||||||
@ -134,6 +135,7 @@ mitm_request and mitm_response methods. The following is a quick example:
|
|||||||
proxy.serve_forever()
|
proxy.serve_forever()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
proxy.server_close()
|
proxy.server_close()
|
||||||
|
```
|
||||||
|
|
||||||
Note: In both cases, the methods that process the data need to return the data back to the proxy handler. Otherwise,
|
Note: In both cases, the methods that process the data need to return the data back to the proxy handler. Otherwise,
|
||||||
you'll get an exception.
|
you'll get an exception.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user