accounter8or
I've always wanted this. You get so spoiled with the Chrome Dev Tools when using Javascript that you miss it when you don't have it.
zug_zug
I've always used a proxy, like charles proxy, for this exact purpose.

A neutral middle-man that gives exact timing/response data.

Jugurtha
That's pretty cool! I was playing last night and implemented resumable downloads[0] for pip so that it could pick up where it stopped upon a network disconnect or a user interruption. It sucks when large packages, especially ML related, fail at the last second and pip has to download from scratch. This tool would have been nice to have. Thanks a bunch,

- [0]: https://asciinema.org/a/1r8HmOLCfHm40nSvEZBqwm89k

judofyr
Looks neat!

A similar tool for this would be VCR (originally built in Ruby, but ported to other languages since): https://vcrpy.readthedocs.io/en/latest/. This injects itself into the request pipeline, records the result in a local file which can then also be replayed later in tests. It's a quite nice approach when you want to write tests (or just explore) a highly complicated HTTP API without actually hitting it all the time.

stuaxo
This is great -

It would be good to be be able to have django debug toolbar integration, that way I could see which requests were made to backend APIs without leaving Django.

Having tried MITMProxy something like httpdbg is definitely needed.

nfgrars
Alternatively use man (1) ngrep for http or man (1) openssl for https.
billconan
this is very useful, but why can it only work with python code? At which level does it intercept the http traffic?

do I have to use specific http library?

linuxdude314
Just use OpenTelemetry. No need to keep reinventing wheels.
cdfuller
Is there a way to use it with jupyter notebooks? `pyhttpdbg -m jupyter notebook` didn't work for me
10000truths
Is there a way to write the trace to a file, instead of spinning up a local web server?
dmurray
This looks great. I have a use case for something similar: detecting calls to the file system. Lots of code I've inherited has a habit of loading configuration from some random network share, then failing when that config got moved or the production host doesn't have the same access.

I usually use strace(1) to track these down, but it's nowhere near as ergonomic as this tool. I'm wondering now if I could patch the `open` built-in instead.

hartator
I wonder if the same exists for Ruby?
ricardo81
I could be lost here (C/PHP/Node coder mainly in code I've used)

Why is it a special case to track HTTP/s requests, that otherwise couldn't be logged like any other process/function? I'd guess most people use libcurl and you can wrap something around that.

I guess I'm lost on why this is HTTP or Python specific, or if it is, fine.

Too
Can recommend Opentelemetry if you need a more comprehensive tool like this.

There is a whole library of so called instrumentation that can monkeypatch standard functions and produce traces of them.

Traces can also propagate across process and rpc, giving you a complete picture, even in a microservice architecture.