* Added magisk module generation
* Fixed typo
* changelog
* Fixed mypy bug
* Changed action based on ubuntu 18.04 due to https://bit.ly/3QOw87Z
* Workflow pinned to ubuntu 20.04
* Moved magisk code to utils and gen on download
* Styling
* Removed magisk from git repo
* Added tests
* Fixed dead line
* Update CHANGELOG.md
* Hardcoded hash
Co-authored-by: Joran van Apeldoorn <joran@bitsoffreedom.nl>
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
Flask 2.2 has compatibility issues with pytest-asyncio (https://github.com/pallets/flask/issues/4773),
but it turns out we don't even need our tests to be async here. So we just use sync tests to fix the CI issues.
* replace blinker with custom implementation
The major benefit here is type checking, followed by proper support for async receivers.
* fix compatibility with Python 3.9
* fix nits
* try harder to force gc
* try harderer
* coverage++
* coverage++
* nits
* allow sockname to specify local-addr
* set local_addr via command line
* minor fix for reconfig
* minor rewording
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Fix handling of multiple Cookie headers when proxying HTTP/2 to HTTP/1
fix#5337
* Add Tests about converts multiple Cookie headers to HTTP/1 from HTTP/2
* Adjust order
* minor code style nits
* Update CHANGELOG.md
* Update _http1.py
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Console tests: don't mess with the mouse
* Fix CommandError when adding a custom view after startup.
Previously, hot-reloading a script with a custom view after at least one flow
was viewed could throw "CommandError: Not viewing a flow" due to show() being
called while the flow view window was not visible.
Additionally, this patch also refreshes the FlowView when a custom view is
removed.
Fixes#5319.
* Test for the fix to #5319.
* Update CHANGELOG to fix#5319
We consistently use "reverse proxy" and not "forward proxy",
so we should do the same for DNS. Also removed "custom" mode.
If users want such things, the correct approach is to specify a reverse
proxy and set `.response` in the request hook (similar to how it works for HTTP)
* Example addon for saving streamed data including a small bug fix to make it work.
* Revert "Example addon for saving streamed data including a small bug fix to make it work."
This reverts commit 02ab78def9.
* Add https_ping_threshold option to enable keep-alive for HTTP/2 server connections by sending PING frames if the conection is idle longer than the threshold.
* Fixed test
* Fix test
* Adding pragma
* Moved timer logic to _http2.py
* Small code improvement
* Update mitmproxy/options.py
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Update mitmproxy/options.py
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Update mitmproxy/proxy/commands.py
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Update mitmproxy/proxy/commands.py
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Update mitmproxy/proxy/layers/http/_http2.py
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Sending Wakup back to right client
* Update mitmproxy/proxy/server.py
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Update mitmproxy/proxy/server.py
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Update mitmproxy/proxy/server.py
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Incorporated suggested changes
Fixed almost all tests
* make `Wakeup` a `CommandCompleted` event.
This allows us to use it with `reply()` in tests,
which makes sure that the correct instance is reused.
# Please enter the commit message for your changes. Lines starting
* nits
`typing.Set` for Python 3.8 compatibility and a few minor stylistic changes.
* nits nits
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
This commit fixes GHSA-gcx2-gvj7-pxv3 by making mitmproxy
reject header names that contain whitespace characters by default.
A new `validate_inbound_headers` option is provided to turn this behavior
off at the expense of allowing HTTP smuggling vulnerabilities.
* Example addon for saving streamed data including a small bug fix to make it work.
* Revert "Example addon for saving streamed data including a small bug fix to make it work."
This reverts commit 02ab78def9.
* Add support for rotating stream files every hour or day
* Added tests
* Modified to change the stream file every time the formating string changes as time moves on.
* Update to more compact version
* simplify save addon logic
* make mypy happy
* fix compatibility with Python 3.8
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
* changes for custom port number
* indent correction
* test coverage
* coverage correction
* simplify LDAP auth
* make mypy hapy
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
We previously relied on the state of `Flow.reply` to check if a flow can be killed,
but this doesn't work anymore with `Flow.reply` being removed. Instead, we now
reintroduce the `Flow.live` attribute, which signals if we are on a live connection.
Killing still is not ideal (see comment in `Flow.killable`), but this paves the way.
The major, breaking change is that it is no longer possible to "take" a reply in
order to block the effect of a later addon hook.
This is patch 4/4 of the reply-ectomy.
In principle, a flow is killable as long as the connection handler is still
checking the error status of the flow.
This is patch 2/4 of the reply-ectomy.
This should improve behaviour, since calls to @concurrent will now be serialized
relative to other hooks on the same flow (but will still run in parallel with
hooks on different flows). Unlike a plain async hook, @concurrent allows blocking
sync APIs to run concurrently (e.g. requests).
This is patch 1/4 of the reply-ectomy.
Previously, it was throwing the following error:
File mitmproxy/addons/dumper.py, line 133, in _echo_request_line
elif flow.client_conn.peername:
AttributeError: 'bool' object has no attribute 'peername'
* Replays via upstream also need to comply with upstream handling
* Adjusted test for HTTP upstream replay which should NOT do a CONNECT
* Added Changelog
* Test for replay https pver upstream with CONNECT
* Proxy requests use full URL with host & port
* Finally remove some prints
* lint!
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Replaced Kaitai protobuf parser with custom implementation, to prepare packed data handling
* Clamp varint size for bool conversion to 64bit, to satify tests
* moved WireParser into ProtoParser
* preserve work state
* Full packed support
* noc changes to example addon
* Adjusted test regex for ValueError
* Do not try to unpack fields twice
* Partial gRPC contentview prototype, not linted, no tests, not as add-on
* Linted (flake8)
* Save dev state
* Rewrote of protobuf parser, use decoding strategy, reduced rendered data. Parser uses generators
* minor cleanup
* fix: preferred encoding was provided as function instead of value
* flake8: line length
* Backlinked message tree objects, temporary debug out
* Partial implementation of gRPC definitions. Save state to fix a cras (data invalidate in edit mode)
* hack: deal with missing exception handling for generator based content views
* gRPC/Protoparser descriptions (with test code)
* replaced manual gzip decoding with mitmproxy.net.encoding.decode
* Refactored typing imports
* Reafctoring
* distinguish request vs response definitions, separate view config from parser config
* Code cleaning, moved customized protobuf definitions to example addon
* final cleanup
* changelog
* Stubs for tests
* Fixed render_riority of addon example
* Started adding tests
* Work on tests
* mypy
* Added pseudo encoder to tests, to cover special decodings
* Example addon test added
* finalized tests, no 100 percent coverage possible, see comments un uncovered code
* minor adjustments
* fixup tests
* Typos
Co-authored-by: Maximilian Hils <git@maximilianhils.com>