Closed sjbarag closed 5 years ago
This looks like a good change. I vaguely recall there was some nuance to scripts in mitmweb, but can't remember any examples. Please test an example script to make sure it works.
Good point! I just tested a very simple outside of this CLI to test mitmweb
:
class ExampleError:
def response(self, flow):
request = flow.request
response = flow.response
if "example.com" in request.host_header:
response.status_code = 500
response.text = "mitmweb sent me"
addons = [ExampleError()]
Run mitmweb -s /path/to/example-error.py
, configure Firefox to use localhost:8080
as its proxy, and load example.com
(you may need a cache-busting refresh). You'll receive a 500 error and the mitmweb sent me
message!
The
mitmweb
interface is much more useful for interactive debugging than themitmdump
version, so let's make it available easily!closes #10