Commit graph

2549 commits

Author SHA1 Message Date
Manuel Meitinger
ebaacfd850 [dns] additional intercept test 2022-04-24 15:25:07 +02:00
Manuel Meitinger
bda488d871 [dns] flowfilter url test 2022-04-24 15:09:06 +02:00
Manuel Meitinger
4229c7c85c [dns] offline tests for proxyserver 2022-04-24 14:56:55 +02:00
Manuel Meitinger
dd61b21ce3 [dns] offline dns_resolve tests at 100% coverage 2022-04-24 14:28:11 +02:00
Manuel Meitinger
0553b73d36 [dns] 100% coverage 2022-04-23 23:31:41 +02:00
Manuel Meitinger
99bcfb7f55 [dns] move resolve code into addon 2022-04-23 22:45:51 +02:00
Manuel Meitinger
c821d02e09 [dns] update layer tests and bugfix 2022-04-23 21:57:22 +02:00
Maximilian Hils
51b640b600 skip internet tests, fix nits 2022-04-23 19:03:25 +02:00
Maximilian Hils
9c33870ac8 move DNS resolution into own addon, simple -> regular 2022-04-23 18:49:16 +02:00
Maximilian Hils
0407d9697b proxy modes: use mitmproxy terminology
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)
2022-04-23 17:05:30 +02:00
Maximilian Hils
2bc43fc10d self-connect: don't resolve
resolving domains here would leak DNS requests if the user aborts,
we don't want that. It's very much a heuristic only anyways.
2022-04-23 16:50:55 +02:00
Maximilian Hils
74f0965a0b Connection.protocol -> Connection.transport_protocol
This is less ambiguous. Also use a string literal to simplify things.
2022-04-23 16:42:11 +02:00
Maximilian Hils
c17e3a16ec dumper: improve dns query display 2022-04-23 16:12:28 +02:00
Maximilian Hils
5c9ab2e774 str -> to_str
`str` is a bit of a footgun because it overrides the builtin `str()` if imported directly.
2022-04-23 13:34:04 +02:00
Manuel Meitinger
976b1a5f27
Merge branch 'mitmproxy:main' into dns 2022-04-22 22:18:14 +02:00
EndUser509
35703b0b6b
HTTP/2 keepalive (#5144)
* 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 02ab78def9a52eaca1a89d0757cd9475ce250eaa.

* 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>
2022-04-22 13:59:55 +02:00
Manuel Meitinger
5b69087a19 [dns] coverage response codes 2022-04-11 01:42:46 +02:00
Manuel Meitinger
9a55989b25 [dns] refactored enums 2022-04-11 01:38:19 +02:00
Manuel Meitinger
16e04d1c49 [dns] use random test ports 2022-04-10 23:05:29 +02:00
Manuel Meitinger
f2c17a7198 [dns] alternate DNS test port 2022-04-10 18:09:49 +02:00
Manuel Meitinger
383dd67a61 [dns] set DNS test port > 1024 2022-04-10 17:57:39 +02:00
Manuel Meitinger
ec1f736171 [dns] proxyserver tests 2022-04-10 17:49:19 +02:00
Manuel Meitinger
563f041ba6 [dns] generalize self-connect test 2022-04-10 11:16:13 +02:00
Manuel Meitinger
c43dbdc79b [dns] minor fixes 2022-04-09 04:29:11 +02:00
Manuel Meitinger
7acc1b2590 Merge branch 'main' of https://github.com/mitmproxy/mitmproxy into dns 2022-04-09 04:03:23 +02:00
Manuel Meitinger
ef3f9e492e [dns] rewrite of udp, merge dnsserver>proxyserver 2022-04-09 03:58:23 +02:00
Maximilian Hils
02d2b6d310
warn users if sse flows are received without streaming, refs #4469 (#5249) 2022-04-06 10:51:58 +00:00
kjy00302
0454f63e98
Fix text truncation for full-width characters (#4278)
* Fix text truncation for full-width characters

* Add test for TruncatedText
2022-04-06 11:17:55 +02:00
Maximilian Hils
6d67a405a9
add Flow.timestamp_created, which retains list order on replay (#5227) 2022-04-06 10:34:17 +02:00
Manuel Meitinger
ea6f9727da [dns] use snake_case in web flows 2022-04-04 05:29:05 +02:00
Manuel Meitinger
b5c115c7a1 [dns] fix simple mode and add tests 2022-04-04 04:30:55 +02:00
Manuel Meitinger
16e7662c87 [dns] domain_names tests 2022-04-04 02:37:33 +02:00
Manuel Meitinger
0a68ff7736 [dns] flowfilter tests 2022-03-31 03:55:16 +02:00
Manuel Meitinger
30cd490c79 [dns] udp reader tests 2022-03-31 01:45:37 +02:00
Manuel Meitinger
9adf715124 [dns] server config test 2022-03-31 00:44:30 +02:00
Manuel Meitinger
2612053415 [dns] layer test full coverage 2022-03-31 00:20:27 +02:00
Manuel Meitinger
993c3e4ee2 [dns] layer test 2022-03-30 23:43:57 +02:00
Manuel Meitinger
4fff28e2a5
Merge branch 'mitmproxy:main' into dns 2022-03-30 20:57:43 +02:00
Maximilian Hils
0fa7c46368
fix cut addon to work with binary content, fix #3965 (#5230) 2022-03-30 12:24:18 +00:00
Manuel Meitinger
f1d937bf4b Merge branch 'main' of https://github.com/mitmproxy/mitmproxy into dns 2022-03-29 22:43:08 +02:00
Manuel Meitinger
86adb1a5a0 [dns] temporarily exclude dns.py and more tests 2022-03-29 17:00:13 +02:00
Manuel Meitinger
c504bc6eb1 [dns] eventsequence test 2022-03-29 16:25:34 +02:00
Manuel Meitinger
fc0bdc143c [dns] view test 2022-03-29 16:16:45 +02:00
Manuel Meitinger
525ac67605 [dns] save test 2022-03-29 16:07:39 +02:00
Maximilian Hils
1bc265ace7
Merge pull request #5226 from mhils/cleanup
`pyupgrade --py38-plus`
2022-03-29 15:36:32 +02:00
Maximilian Hils
9d1e3107e8 pyupgrade --keep-runtime-typing --py38-plus 2022-03-29 15:29:37 +02:00
Manuel Meitinger
1ad264781b
Merge branch 'mitmproxy:main' into dns 2022-03-29 15:27:36 +02:00
Maximilian Hils
b8bed1d770
errorcheck: print message to stderr for console UI (#5225) 2022-03-29 15:26:46 +02:00
Maximilian Hils
f0da667516
tlsconfig: make sure to use the correct connection, fix #5109 (#5224) 2022-03-29 08:27:53 +00:00
Manuel Meitinger
08a9a1be5c [dns] more tests 2022-03-28 17:29:47 +02:00