惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
Blog — PlanetScale
Blog — PlanetScale
腾讯CDC
aimingoo的专栏
aimingoo的专栏
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans
J
Java Code Geeks
G
Google Developers Blog
N
Netflix TechBlog - Medium
Vercel News
Vercel News
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
I
InfoQ
Stack Overflow Blog
Stack Overflow Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
罗磊的独立博客
GbyAI
GbyAI
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
WordPress大学
WordPress大学
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

Posts on mitmproxy.org

Mitmproxy 12: Interactive Contentviews Intercepting Linux Applications Mitmproxy 11: Full HTTP/3 Support Mitmproxy 10.4: Mitmweb Capture Tab Intercepting Windows Applications Intercepting macOS Applications Mitmproxy 10: First Bits of HTTP/3! A more user-friendly transparent mode, based on WireGuard Mitmproxy 9 Mitmproxy 8 Google Summer of Code 2021 Mitmproxy 7 A New Proxy Core, Sans I/O Mitmproxy 6 Mitmproxy 5.3 Mitmproxy 5.2 Mitmproxy 5 Mitmproxy 4 Google Summer of Code 2018 Mitmproxy 3
Mitmproxy 10.1: HAR Support
Nathaniel Good · 2023-09-24 · via Posts on mitmproxy.org
24 Sep 2023,

We are excited to announce the release of mitmproxy 10.1! In the spirit of shipping more frequently, this release brings exactly one new major feature: HAR file support.

Editorial Note: Hi!

My name is Nathaniel Good, and I’m one of this year’s Google Summer of Code students for mitmproxy, mentored by Maximilian Hils. My project was to implement the import and export functionality for HAR files in mitmproxy.

Background: HAR files

HTTP Archive (HAR) files are used by a variety of tools to store a log of the interactions a web browser makes with a site. Numerous tools like Chrome, Firefox, and Insomnia can work with HAR files, allowing users to move data between these tools. Starting with this release, mitmproxy reads and writes HAR files as well.

HAR Import

HAR files have a specification they should follow, but unfortunately, most tools slightly differ in their representation. This goes so far that the W3C Web Performance Group has abandoned its attempt to produce a more formal standard. We have taken this as a challenge and made sure mitmproxy will be able to import most1 HAR representations.

Loading HAR files works exactly like loading mitmproxy’s native flow files. mitmproxy automatically detects the correct file format (HAR or native) and does not depend on the file extension:

Loading a HAR file on startup

$ mitmproxy -r example.har

Loading a HAR file in an active mitmproxy session

$ view.flows.load example.har

HAR Export

As previously stated, there are various “interpretations” of the HAR specification. When exporting flows, mitmproxy will mostly follow Chrome’s representation to ensure broad compatibility.

Exporting from client

For exporting flows into a HAR file, you can use the new save.har command from within mitmproxy:

: save.har @all example.har

Exporting on exit

For non-interactive use, you can also use the hardump option to save all flows into a HAR file on exit:

$ mitmdump --set hardump=dump.har  

Exporting to stdout

Following standard unix conventions, you can set the hardump option to - to print the HAR file to stdout on exit:

$ mitmdump -q --set hardump=- 

Full Changelog

  • Add support for reading HAR files using the existing flow loading APIs, e.g. mitmproxy -r example.har. (#6335, @stanleygvi)
  • Add support for writing HAR files using the save.har command and the hardump option for mitmdump. (#6368, @stanleygvi)
  • Packaging changes:
    • mitmproxy-rs does not depend on a protobuf compiler being available anymore, we’re now also providing a working source distribution for all platforms.
    • On macOS, mitmproxy-rs now depends on mitmproxy-macos. We only provide binary wheels for this package because it contains a code-signed system extension. Building from source requires a valid Apple Developer Id, see CI for details.
    • On Windows, mitmproxy-rs now depends on mitmproxy-windows. We only provide binary wheels for this package to simplify our deployment process, see CI for how to build from source. (#6303, @mhils)
  • Increase maximum dump file size accepted by mitmweb (#6373, @t-wy)