From 72050ab0e4ec6b5ad3fad03d4941925ef254f10b Mon Sep 17 00:00:00 2001 From: allfro Date: Mon, 23 Jul 2012 21:09:41 -0300 Subject: [PATCH] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6be750a..f43ebfd 100644 --- a/README.md +++ b/README.md @@ -109,8 +109,9 @@ Method Overloading ------------------ 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 class MitmProxyHandler(ProxyHandler): @@ -134,6 +135,7 @@ mitm_request and mitm_response methods. The following is a quick example: proxy.serve_forever() except KeyboardInterrupt: proxy.server_close() +``` 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.