For diagnostics I'd prefer something like Paros[2], Burp[3] or WebScarab[4], which has a graphical interface, but this one seems to offer a quite nice scripting API which I'll have to take a closer look at.
[1] http://crypto.stanford.edu/ssl-mitm/
[2] http://www.parosproxy.org/
[3] http://www.portswigger.net/burp/proxy.html
[4] https://www.owasp.org/index.php/Category:OWASP_WebScarab_Pro...