Commit graph

820 commits

Author SHA1 Message Date
Matteo Luppi
40f345204c
Web: Show Local timezone in the Timing tab (#7804)
* show local datetime

* Add TZ=UTC in test script

* update changelog

* review changes

* [autofix.ci] apply automated fixes

* review changes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-08 08:08:30 +02:00
Maximilian Hils
b5ac8e62ea
add CSS and JS syntax highlighting (#7749)
* add CSS and JS syntax highlighting

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-06-01 13:19:14 +02:00
Maximilian Hils
e683c737f6
Ensure syntax highlighting is consistent between Rust and mitmweb (#7741)
* ensure syntax highlighting is consistent between Rust and mitmweb

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-05-30 23:21:40 +02:00
Matteo Luppi
3ead2ab150
Web: Fix crash when no explicit Server-Connection is logged (#7734)
* fix bug

* update changelog

* nit review
2025-05-28 13:55:04 +02:00
Maximilian Hils
5e15aacae5
Web: simplify connection state reducer (#7728)
* web: simplify connection state reducer

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-05-26 18:57:25 +02:00
Maximilian Hils
1207e9d2e8
web: account for race conditions during flow fetching (#7729)
* web: account for race conditions during flow fetching

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-05-25 16:43:01 +02:00
Matteo Luppi
e87f699f8a
Web: search/highlight by body content (#7704)
* Add 'updateFilter' method to the current websocket connection (#7421)

* specify types

* create backend singleton class and remove window.backend

* add example of sending a message through web socket

* back to previous version

* make sendMessage private and add updateFilter function

* send correct messages

* remove console logs

* update snapshot

* remove unrelated stuff

* [autofix.ci] apply automated fixes

* remove console.log

* move the backend update in the redux duck

* remove circular dependency, use window.backend

* improve typing

* remove cyclic dependency on backend instance

* [autofix.ci] apply automated fixes

* type -> icon naming

* remove partial

* back to prev approach and solve cyclic dependencies

* [autofix.ci] apply automated fixes

* nit

* add comment

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>

* Fix bug when sending a message while CONNECTING (#7467)

* fix problem while connecting + add more tests

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* web: add server-side filters (#7506)

* fix logic and conflicts

* fix tests

* client side logic to show/hide filters

* move message information inside payload

* leftover

* update filt.peg and filt.js

* [autofix.ci] apply automated fixes

* update existing tests

* [autofix.ci] apply automated fixes

* websocket broadcaster: add send task

this ensures that messages are sent in order

* websocket broadcaster: nits

* filtersUpdated -> filterUpdate

* wip: fixup flows store

* store: move flows off immer

* move flow backend actions

* bench++

* web flows: object -> map/set

* lint!

* tests++, fixes++

* web: tests++, fix sort

* be explicit about missing search filters

* fix flow deletion

* wip

* [autofix.ci] apply automated fixes

* incorporate review feedback

* add tests for view utils

* fix nits

* fix compatibility with nodejs 18

* update app.js

* nits

* [autofix.ci] apply automated fixes

* update app.js

* changelog++

* cov++

* untangle store and backend

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2025-05-23 20:44:33 +02:00
Maximilian Hils
d7c36bb18b
web: remove unused prop-types dependency (#7722) 2025-05-23 07:35:15 +02:00
Maximilian Hils
a6814fec48
web: move eventlog reducer off immer (#7714)
* web: move eventlog reducer off immer

* web: add eventlog benchmark
2025-05-19 18:04:17 +02:00
Maximilian Hils
e12bb695c5
fix display of ipv6 addresses (#7700)
* fix display of ipv6 addresses

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-05-14 19:16:26 +02:00
Maximilian Hils
76f407d709
web: Upgrade to CodeMirror 6 (#7709)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-05-14 17:30:11 +02:00
Maximilian Hils
b49264cfbd
web: upgrade dependencies (#7707) 2025-05-13 22:56:11 +02:00
Maximilian Hils
6b0309f77a
web: misc improvements (#7706)
Co-authored-by: Matteo Luppi <100372313+lups2000@users.noreply.github.com>
2025-05-12 19:31:18 +00:00
Maximilian Hils
4be711c3a1
web: increase typescript use for ducks (#7692)
* web: increase typescript use for ducks

* tests++

* web: move event log off store abstraction

* [autofix.ci] apply automated fixes

* exclude typescript guards from coverage

* fix coverage

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-05-09 20:35:33 +02:00
Maximilian Hils
eea4addf00
Web: fix nits (#7693)
* remove tabs.isInitial

this was not used in the first place

* fix docs links

* fix headerlookup

WeakMap allows us to finally have proper cache invalidation

* store capture tab in url state
2025-05-05 11:13:50 +02:00
Matteo Luppi
01a5cceeac
[web] replay multiple selected flows (#7674)
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2025-04-29 12:45:19 +02:00
Matteo Luppi
519200e6d2
[web] add multiple flow selection (#7319)
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2025-04-27 12:21:50 +02:00
Maximilian Hils
4e8eef805b
migrate to new contentview API, make DNS interactive (#7670)
* migrate all views to new contentview API
* make DNS view interactive
* rename dns.Message to DNSMessage
2025-04-25 15:17:12 +00:00
Maximilian Hils
d0a35dcf9b
introduce new contentview API (#7623) 2025-04-21 14:56:58 +02:00
Matteo Luppi
3ed7a63336
Local mode UX enhancement in mitmweb (#7643)
* improve local mode UI/UX

* update tests
2025-04-11 11:37:01 +02:00
Matteo Luppi
f33f4dd1d6
Fix mitmweb crash when searching/highlighting by ~h/~hq/~hs (#7652)
* check for undefined headers

* update changelog
2025-04-10 22:05:18 +02:00
Matteo Luppi
5f28814482
Adjust popover anchor positioning (#7642)
* adjust popover position

* update changelog
2025-04-09 23:34:03 +02:00
Mark Kiami
d33090b4f3
Log streamed bodies (#7637)
* Add new feature: storing of request and response streaming bodies

* Fix unit test by regenerating the options file with options_js.py

* Add test cases with store_streamed_bodies True and False

* Update Changelog

* Update Changelog with pull request ID

* [autofix.ci] apply automated fixes

* Update test with a dedicated test case for store_streamed_bodies

* Remove unnecessary option store_streamed_bodies from options.py

* Update docstrings for store_streamed_bodies and stream_large_bodies.

* Update docstring for store_streamed_bodies since it is not used anywhere in practice here.

* Fix typo in test_http.py

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-04-07 20:09:53 +02:00
Emanuele Micheletti
f373ccf45b
Preventing mitmweb crash when viewing flows with undefined headers (#7595)
* fix: check on msg.header

fix #7557

* changelog

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-03-11 22:23:24 +01:00
Maximilian Hils
395e641573
Ensure that all mitmweb options have help text. (#7563)
docs++
2025-02-16 21:46:30 +00:00
Maximilian Hils
3915c5af78
Revise Proxy Mode Docs (#7545)
* revise proxy mode documentation

* docs++

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-09 12:27:07 +01:00
Maximilian Hils
0bd573a599 web: add password-based authentication 2025-02-05 23:37:33 +01:00
Matteo Luppi
385800f07f
web: copy request/response data to clipboard (#7352)
* create ui component for copying content

* write function to copy viewcontentdata to clipboard

* add type string to url

* call the endpoint to fetch the full content

* update snapshots

* disable button after copying text

* update changelog

* remove disable on copy button

* [autofix.ci] apply automated fixes

* disable copy button while fetching

* [autofix.ci] apply automated fixes

* adjust isFetching and isCopied position

* hide copy button if there is no content

* update snapshot

* Delete web/src/templates/index.html

* adjust naming convention

* update test

* update snapshots

* nits

* add async/await

* [autofix.ci] apply automated fixes

* improve test coverage

* improve even more test coverage

* test coverage final improvement

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2025-02-03 23:37:40 +00:00
Maximilian Hils
b761cb46c4
Web: harden xsrf_token usage (#7491)
web: harden `xsrf_token` usage
2025-01-19 20:40:55 +05:30
Maximilian Hils
e78ab0ffd9
web: remove unnecessary template copying build step (#7490) 2025-01-17 18:09:45 +01:00
Matteo Luppi
18a29df7d0
Improve typing FilterInput component (#7426)
improve typing FilterInput component
2025-01-01 13:00:39 +01:00
Matteo Luppi
2181669f1f
Update options ui duck to rtk (#7368)
* use rtk in modal duck

* adapt flow duck to rtk

* export HIDE_MODAL event type

* change object to string in selectTab

* [autofix.ci] apply automated fixes

* update options ui duck to rtk

* [autofix.ci] apply automated fixes

* add explaining comment

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-31 14:55:03 +01:00
Matteo Luppi
e0434726f3
Exposing 'localModeUnavailable' to the frontend (#7390)
* expose localModeUnavailable

* adapt frontend

* update gen file

* [autofix.ci] apply automated fixes

* add default description

* style

* use 'localModeUnavailable' to check

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-11 16:57:19 +01:00
Matteo Luppi
0045c1f31b
allow single click to edit URL request (#7385)
* allow single click to edit URL request

* update changelog

* [autofix.ci] apply automated fixes

* update changelog

* use 'selectAllOnClick' instead of 'setCursorOnClick'

* remove 'selectAllOnClick' from capture tab page

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-10 21:19:06 +01:00
Maximilian Hils
016f311944
Implement Cache-Busting for mitmweb (#7386)
* cache-bust front end artifacts

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-10 08:07:35 +01:00
Matteo Luppi
6dce751e62
update commandBar duck to RTK (#7370) 2024-12-04 09:42:48 +01:00
Matteo Luppi
34df78c7f3
Update flow.ts and modal.ts ducks to RTK (#7311)
* use rtk in modal duck

* adapt flow duck to rtk

* export HIDE_MODAL event type

* change object to string in selectTab

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-28 19:11:07 +01:00
Matteo Luppi
006f8c97c4
Invert check for unsupported platforms in local mode (mitmweb) (#7349)
invert the check for unsupported platform in local mode
2024-11-28 19:10:05 +01:00
Maximilian Hils
999562a6e2
Align web/gen and ruff format (#7342)
align web/gen and ruff format
2024-11-23 06:20:26 +01:00
Maximilian Hils
69f455b962
Add tun proxy mode on Linux (#7278)
* simplify stream handling callback

* add `tun` proxy mode from mitmproxy_rs

* tun mode: tests++

* [autofix.ci] apply automated fixes

* bump mitmproxy_rs

* fix bugs

* ci: use macOS 13 for builds as 12 is being phased out

* test debugging

* bump mitmproxy_rs

* bump python version in ci, 3.13 is stable now

* nits

* is unshare to blame?

* how about this?

* coverage++

* [autofix.ci] apply automated fixes

* debüg

* debüüg

* debüüüg

* bump mitmproxy_rs

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-29 02:34:39 +05:30
Matteo Luppi
c346f038f8
web: arbitrary strings in local mode (#7257)
* add regex to handle commas

* add arbitrary strings in local mode

* adjust no result string
2024-10-18 18:29:44 +02:00
Matteo Luppi
96a1b934be
Display Grayed-Out Mode for Unsupported Platforms (#7244)
add missing mode component
2024-10-14 23:11:33 +02:00
Nicolai Søborg
a44191a9b1
Add --show-ignored-hosts (#6720)
* Add `--show-ignored-hosts`

Maybe a bit counterintuitive, but mitmproxy is very nice even without
the MITM part.  When doing `--ignore-hosts '.*'` it is not possible to
see SNI's, so add new flag to show the raw TCP/UDP streams.

Fixes #6421

* Add tests for `--show-ignored-hosts`

* Changelog for `--show-ignored-hosts`

* [autofix.ci] apply automated fixes

* fixups

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
2024-10-01 15:28:28 +00:00
Matteo Luppi
e1ea491ad7
expose available web columns to Python (#7205)
* add script to generate all possible web columns

* remove test for now

* Make web_columns.py executable

* [autofix.ci] apply automated fixes

* add back tests

* [autofix.ci] apply automated fixes

* update changelog

* update changelog and add coauthor

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Abhishek-Bohora <abhishek.bohora16@gmail.com>
2024-09-22 19:21:41 +02:00
Maximilian Hils
f8b742753b
Enable HTTP/3 in transparent mode by default (#7202)
* fixup raw quic handling

* enable HTTP/3 in transparent mode by default

* fix nits
2024-09-21 14:29:31 +00:00
Maximilian Hils
358fca3e72
tls_version: QUIC -> QUICv1 (#7201)
* tls_version: QUIC -> QUICv1

this aligns us with what OpenSSL is returning

* tests: add quic dumpfile
2024-09-21 16:22:09 +02:00
Thomas Kriechbaumer
2c1802692d
options: add request_client_cert to enable mutual TLS (#7175)
* options: add request_client_cert to enable mutual TLS

This capability was already built-in but hard-coded to be disabled. Making it configurable as option (defaulting to off) enables mTLS connections between clients and mitmproxy. If true, mitmproxy will send a TLS `CertificateRequest` message to the client during the TLS handshake, upon which a client needs to present a client certificate to mitmproxy to successfully establish an mTLS connection.

This option can be used together with the `client_certs` option to also establish an mTLS connection between mitmproxy and the upstream server. In this case, mitmproxy needs to have a full client cert, including matching private key, that is trusted and accepted by the upstream server. This is a common scenario with MQTT or IoT connections.

Example usage:
$ mitmproxy --set request_client_cert=True --set client_certs=some_directory/

With `some_directory/` containing a `mqtt.example.com.pem` x509 certificate file (including private key).

This allows a client connecting using mTLS, to be intercepted by mitmproxy, which is itself establishing an mTLS connection to the `mqtt.example.com` upstream server. Restricting the client_certs using a directory and PEM files named after the upstream domain, narrows down the mTLS requirement to this single domain, while leaving all other traffic through mitmproxy untouched (normal TLS without client certs).

* add CHANGELOG entry

* docs++

* swap section order, re-add example

---------

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
2024-09-18 19:48:41 +02:00
Matteo Luppi
9740477e8b
Feature/local applications selector (#7141)
* add refresh icon

* first draft drop down

* create logic to store and display current applications + fix old tests

* [autofix.ci] apply automated fixes

* filter applications based on the input

* add classname prop to popover

* add icon classname to popover

* change design local dropdown and applications list

* adjust focus popover and dropdown

* fetch all current processes

* [autofix.ci] apply automated fixes

* add icon while fetching

* adjust icon rendering

* remove icon from interface

* add possibility to remove application

* remove checkmarks popover

* fix icon application

* [autofix.ci] apply automated fixes

* move popover to the bottom

* fix clasname test

* loading lazy img

* move processes to a redux state

* change naming variables

* [autofix.ci] apply automated fixes

* leftover

* adjust naming style

* update snapshot

* move the current processes in a dedicated redux state

* not use display_name anymore for spec

* [autofix.ci] apply automated fixes

* add comments

* add tests local dropdown

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-09 13:38:35 +02:00
Matteo Luppi
8195d686ce
improve UX reverse dropdown (#7164)
* use select

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-06 11:00:44 +02:00
Matteo Luppi
59129de1fb
Improve design capture page (#7160)
* improve style capture page

* use left-border

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-04 16:23:06 +02:00