mitmproxy/mitmproxy — pull request #193 by droope (2013-12-25 04:14:59+00:00)
Title: Search functionality

Hi there,

First of all, thanks for writing this software. It is not often that one can feel so comfortable on foreign codebase, I really liked hacking on it and I think there is great need for open source interception proxies. The fact that it is command-line makes it a dream come true =)

I've been working on some functionality that allows for searching within the flowview view, which can be convenient when searching for arbitrary strings whether they be on the request body or the response body.

### use case

The use case that I found is the following:

James is attempting to find flaws in website X, and while attempting some injections on some fields he needs to find out quickly if the element with class `user-errors` has got any errors.

After applying this patch, James can press `/` and enter 'user-errors'. This will call the function flowview.search, which will search through the response/request body and will highlight the search keywords if present, and will also automatically focus the UI in the line where the string was found.

### future

In the future, I intend to add functionality for "auto searching", which will mean that when the request is finished, it will automatically focus the string the user is aiming to find.

I would also like it to search in headers.

### code changes

I've had to make many changes to the codebase but I don't feel any of them are particularly ofensive :P Let me know, anyway!

All tests are passing, except one that was failing at fork-time.

Thanks,
Pedro