Repolode
cle-b

cle-b/httpdbg

A Python debugging tool that records HTTP(S) requests made by a program, including server-side requests, and shows them in a local web UI.

Stars
907
Forks
28
Open issues
5
Last commit
4 days ago

What is it?

httpdbg helps Python developers see the HTTP(S) traffic their programs produce. You run a script, module, test suite or interactive console with the pyhttpdbg command instead of python, and every request is captured and shown in a web interface at localhost:4909, grouped by the function that initiated it.

It covers both sides of the connection. Client requests from requests, urllib3, httpx and aiohttp are recorded by default, and server-side requests handled by Flask and FastAPI can be traced too. Requests made during pytest or unittest runs are grouped by test. HTTP/1.0, HTTP/1.1 and HTTP/2 (the latter through the h2 library) are supported.

Traces can be exported to a single HTML file for sharing, and extra packages can be registered as initiators with the -i option.

Key features

  • 01Records client requests from requests, urllib3, httpx and aiohttp.
  • 02Traces server-side requests handled by Flask and FastAPI.
  • 03Groups requests by test for pytest and unittest runs.
  • 04Supports HTTP/1.0, HTTP/1.1 and HTTP/2.
  • 05Exports traces to a standalone HTML file.

Use cases

  • Inspecting which API calls a Python script makes during execution.
  • Checking what HTTP requests pip or another module sends.
  • Debugging which requests a test suite makes and where they originate.
  • Viewing incoming requests to a local Flask or FastAPI development server.

Quick start

  1. 1

    Install httpdbg from PyPI

    pip install httpdbg
  2. 2

    Run your script under httpdbg and open http://localhost:4909 to view requests

    pyhttpdbg --script filename.py

Things to know

  • Server-side request recording is new and still a work in progress for some frameworks.
  • HTTP/2 support requires the h2 library.

In collections

Topics

FAQ

What is httpdbg?
A Python debugging tool that records HTTP(S) requests made by a program, including server-side requests, and shows them in a local web UI. httpdbg helps Python developers see the HTTP(S) traffic their programs produce. You run a script, module, test suite or interactive console with the pyhttpdbg command instead of python, and every request is captured and shown in a web interface at localhost:4909, grouped by the function that initiated it.
Is httpdbg free to use? What license does it have?
httpdbg is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is httpdbg still maintained?
Actively maintained. The last commit to httpdbg was on Nov 2, 2026.
What can I use httpdbg for?
Inspecting which API calls a Python script makes during execution. Checking what HTTP requests pip or another module sends. Debugging which requests a test suite makes and where they originate. Viewing incoming requests to a local Flask or FastAPI development server.
How do I install httpdbg?
Install httpdbg from PyPI: pip install httpdbg Run your script under httpdbg and open http://localhost:4909 to view requests: pyhttpdbg --script filename.py
Where can I get httpdbg?
The source code and installation instructions are on GitHub: https://github.com/cle-b/httpdbg

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects