News for hackers. Stuff that matters.

cle-b

Show HN: Pytest-httpdbg – a simple way to include HTTP traces in Allure reports

https://github.com/cle-b/pytest-httpdbg

Hi HN,I recently updated my pytest plugin based on httpdbg to include the HTTP traces directly in the Allure reports. As with httpdbg, the idea is to have nothing more to do than to add an argument to your command line: --httpdbg-allure.For example:pytest examples/pytest_demo.py --alluredir=./allure-results --httpdbg-allureFor each test, all HTTP requests will be recorded and saved in the...

( Read More... | no comments | 2 points | on HN )

Show HN: Hookdns (for Python devs)- Because /etc./hosts is not always an option

https://github.com/cle-b/hookdns

Hi,The aim of this Python library is to let you define (or override) DNS resolution directly in your code. No need to modify the hosts file or use an external DNS resolver.I created this library as a toy project a few years ago, mainly to learn how to use GitHub Actions (not really for what the library itself does).I never really shared it before because I don't use it myself, but since a few...

( Read More... | 1 comment | 2 points | on HN )

Show HN: See what your Python app sends and receives over HTTP

https://httpdbg.readthedocs.io/en/latest/

Hi,A few months ago, I shared a tool I built for personal use to easily trace HTTP client requests in any Python app. It links requests to the corresponding Python code and comes with a nice UI. By easily, I mean: no external dependencies, no setup, no superuser rights, and no code modifications — just do "pip install httpdbg" and then launch your code using the "pyhttpdbg" command. That’s it.I...

( Read More... | 1 comment | on HN )
I really like vrcpy. I used it a lot with pytest in my previous job. httpdbg isn’t exactly the same; the idea is more about seeing HTTP requests in real-time and being able to easily study them.
Unlike other tools such as proxies that allow you to trace HTTP requests, httpdbg makes it possible to link the HTTP request to the Python code that initiated it. This is why it is specific to Python and does not work with other languages.
It works only with Python code because it intercepts HTTP requests by hooking into certain Python functions.

It supports any HTTP library based on Python’s standard socket library. Specifically, it works with libraries like requests, httpx, aiohttp, and urllib3, as well as pytest, providing more detailed information about the initiator of the requests.

If you want to trace the HTTP requests in a notebook, you must install the package notebook-httpdbg.

This is documented here: https://httpdbg.readthedocs.io/en/latest/notebook/

Show HN: Httpdbg – A tool to trace the HTTP requests sent by your Python code

https://github.com/cle-b/httpdbg

Hi,I created httpdbg, a tool for Python developers to easily debug HTTP(S) client requests in Python programs.I developed it because I needed a tool that could help me trace the HTTP requests sent by my tests back to the corresponding methods in our API client.The goal of this tool is to simplify the debugging process, so I designed it to be as simple as possible. It requires no external...

( Read More... | 55 comments | 27 points | on HN )