Forgot this was written in python. Scanned the code to see how they do http/2. This lib seems useful for general python use:
https://github.com/mitmproxy/mitmproxy/tree/master/pathod
https://github.com/mitmproxy/mitmproxy/blob/master/mitmproxy...
The whole package very well written. I'll definitely read through it and add it to my list of repos people should scan if they work with python.