Make mitm work as a transparent proxy
This incorporates a bunch of work that @bmizerany did to make mitm work as a transparent proxy, plus some small changes we've done at Rainforest. It would be great to get it merged upstream if it makes sense. One thing I'm not entirely clear about (perhaps @bmizerany can clarify) is whether this will still work as an explicit proxy or additional work is necessary for that. @kr let me know what would need to be fixed to get this merged upstream.
@shosti do you (still) use the rainforestapp/mitm fork? Thinking of trying this out in service of setting up a staging environment that can transparently mock (or at least sniff requests to) external HTTPS services. If it works, it seems like it would be easier to deploy than mitmproxy, but I'd want at least some kind of verbal encouragement from the fork maintainer that it's serviceable for internal use (with no warrantee implied or blah blah blah).
To be perfectly honest, we do use this internally but it’s heavily customized for our use case. I would recommend using mitmproxy for most projects since it’s better maintained.