Aldo Cortesi
264a09e778
Let's dispense with this fiction that we support multiple servers
...
It's simple enough to re-add if needed, and until then is just cruft.
2016-10-19 12:37:32 +13:00
Aldo Cortesi
87629586ae
web app cleanups: tests and examples
2016-10-19 11:48:51 +13:00
Aldo Cortesi
ceb8caee98
Web apps to addons
...
This commit removes the app registry, adds a wsgiapp addon base, and ports the
onboarding app to it.
2016-10-19 11:40:51 +13:00
Aldo Cortesi
03cb5bb325
No need for all builtins to be loaded for server tests
2016-10-18 22:30:21 +13:00
Aldo Cortesi
466f5e56a1
Convert flow.state to an addon
...
A first step, and already many things are much nicer.
2016-10-18 21:51:36 +13:00
Aldo Cortesi
d5056c5627
accept_addon -> resume, intercept/resume events
2016-10-18 12:02:35 +13:00
Aldo Cortesi
825b02d495
master.duplicate_flow -> state.duplicate_flow
...
This is a pure operation on state, and doesn't belong on master.
Part of prep to move state to an addon.
2016-10-18 11:29:51 +13:00
Aldo Cortesi
b25d94a6ac
Response body streaming to addon
2016-10-18 10:42:05 +13:00
Maximilian Hils
beed406058
fix tests
2016-10-17 03:37:42 -07:00
Thomas Kriechbaumer
94c9dd66e6
remove empty lines at beginning of file
2016-10-17 10:32:12 +02:00
Maximilian Hils
758860531a
fix socks5 mode with tls
2016-10-16 23:05:51 -07:00
Aldo Cortesi
c774a9fec9
python3: clean up super and __future__
2016-10-17 18:03:07 +13:00
Aldo Cortesi
a647b30365
python3: clean up class brackets
2016-10-17 17:37:08 +13:00
Aldo Cortesi
fb22f2ff4f
Zap object base class
2016-10-17 17:37:08 +13:00
Aldo Cortesi
ce98a9219e
test & examples: zap six
2016-10-17 16:45:45 +13:00
Aldo Cortesi
9a0195bf64
scripts: keep scripts just after the ScriptLoader in addon chain
...
We need scripts to run _before_ filestreamer, so we can't just add them to the
end of the chain. This patch also fixes an issue that could cause scripts to be
initialised un-necessarily if only the order of scripts in options changed.
2016-10-16 20:26:06 +13:00
Aldo Cortesi
fb69c9c345
docs: overview, classes, arguments
2016-10-16 20:26:06 +13:00
Maximilian Hils
e9284ab7ee
add regression test for #1605
2016-10-14 01:22:30 -07:00
Aldo Cortesi
89d36713e3
certutils: cap the cert store size at 100 by default
...
This should be enough to give us reuse without growing infinitely. This is part
of fixing the memory situation in mitmdump.
TODO: There's an opportunity here for a better algorithm, that expires certs
based on least-recently-accessed time, rather than oldest generated time.
2016-10-05 10:44:31 +11:00
Thomas Kriechbaumer
90898f9084
use flt instead of filt for flowfilter expressions
2016-10-04 14:51:04 +02:00
Aldo Cortesi
882c363ec5
debug: Hard exit after debug signal
2016-10-04 16:48:13 +11:00
Aldo Cortesi
7fe09f4d26
Consolidate logging
...
- Make log event handler work
- Move terminal event log into an addon
- Clean various log related errors and duplications
2016-10-04 13:00:15 +11:00
Aldo Cortesi
2e48b60ff1
Clarify channel interaction pattern
...
Before this patch, it wasn't clear when the arguments to an event could be
modified, and when a new object should be returned. After this patch, the right
thing to do is to modify the arguments in 99% of cases. The only exception to
this is root_layer, for which we can find a better structure down the track.
2016-10-04 08:13:56 +11:00
Aldo Cortesi
1ae73b9157
Add requestheaders event
...
HTTP1 only for now, HTTP2 coming next.
2016-10-04 08:13:56 +11:00
Thomas Kriechbaumer
36c04f1631
fix flowfilter.match args
2016-10-03 12:04:17 +02:00
Thomas Kriechbaumer
bb60b76af4
use flowfilter.match
2016-10-03 11:45:54 +02:00
Thomas Kriechbaumer
ba84248910
rename mitmproxy.filt -> mitmproxy.flowfilter
2016-10-03 11:45:54 +02:00
Maximilian Hils
611dad12a7
Revert "Add API to programmatically create new requests ( #1534 )"
...
This reverts commit ccbdcd684b
,
which yielded a test timeout.
2016-10-02 23:08:51 -07:00
Tyler St. Onge
ccbdcd684b
Add API to programmatically create new requests ( #1534 )
2016-10-01 13:06:59 +02:00
Aldo Cortesi
070aa27cf5
parse_set_cookie header returns an empty list if no cookies are found
...
This matches parse_cookie, and is more idiomatic.
2016-09-28 15:10:31 +10:00
Aldo Cortesi
b21f076cc8
Merge branch 'multi-cookie' of https://github.com/dufferzafar/mitmproxy
2016-09-28 12:44:40 +10:00
Shadab Zafar
5383c15ff2
Add tests for comma separated Set-Cookies
2016-09-27 21:28:54 +05:30
Ryan Laughlin
ad6d675b20
In reverse proxy mode, always send SNI
2016-09-27 10:49:04 -04:00
Shadab Zafar
e8ffc5167b
Can't have , in the sticky cookie test
...
Since we support comma separated cookies now
2016-09-27 16:44:09 +05:30
Shadab Zafar
9ec0790271
Make needed changes in tests
2016-09-27 16:44:09 +05:30
Shadab Zafar
85bf5e18f6
Update cookie tests
...
This is needed since _read_pairs now returns a list of cookies each of which
is a list of [name, value] tuples.
2016-09-27 16:44:08 +05:30
Maximilian Hils
eeec17902f
update dependencies, minor fixes ( #1577 )
2016-09-24 21:01:48 -07:00
Maximilian Hils
0a643ad20f
remove option argument for addons.add ( #1576 )
2016-09-24 18:21:12 -07:00
Maximilian Hils
9142da1a7d
Merge pull request #1566 from mhils/issue-1546
...
add websocket on/off switch, improve logging (fix #1546 , fix #1547 )
2016-09-22 03:06:39 -07:00
Maximilian Hils
77868434e7
fix tests
2016-09-22 02:10:02 -07:00
Maximilian Hils
a3329c5a80
scripts: cut traceback properly, fix #1467
2016-09-22 02:03:12 -07:00
Maximilian Hils
9e0b935fa2
Merge pull request #1564 from mhils/issue-1554
...
Fix Response.make content-length header
2016-09-21 21:49:14 -07:00
Maximilian Hils
0b532789a0
fix Response.make content-length header
2016-09-21 20:34:01 -07:00
Maximilian Hils
770936f1f9
raise TypeError on invalid header assignment, fix #1562
2016-09-21 19:21:32 -07:00
Aldo Cortesi
cfb943bfdd
Redesign client replay
...
- Move to an addon
- Use a much simpler synchronisation mechanism
2016-09-11 20:00:34 +12:00
Aldo Cortesi
6b9221ffeb
Add "run_once" support to the script addon, use it in mitmproxy
...
Fixes #1418
2016-09-11 13:22:01 +12:00
Aldo Cortesi
9b814ca067
options.replay_ignore* -> options.server_replay_ignore*
2016-09-10 10:21:52 +12:00
Aldo Cortesi
8677e91074
options.nopop -> options.server_replay_nopop
2016-09-10 10:09:07 +12:00
Aldo Cortesi
5ebe8c1bc8
options.rheaders -> options.server_replay_use_headers
2016-09-10 10:09:07 +12:00
Aldo Cortesi
b0213a2c0e
options.kill -> options.replay_kill_extra
2016-09-10 10:09:07 +12:00
Aldo Cortesi
4ff8a72521
Roll out synchronisation for mitmproxy tests
...
This extends some of the work I did for pathod and netlib to the mitmproxy test
suite. It also fixes what may be a leak in replays.
Failing on connection leak is disabled on Windows for the moment.
Fixes #1535
2016-09-10 09:18:11 +12:00
Aldo Cortesi
ea49b8a2e2
Merge pull request #1532 from cortesi/playback
...
Playback and fix construct breakage
2016-09-07 12:59:11 +12:00
Schamper
5728a1c900
Make 'none' synonymous to 'identity'
2016-09-06 17:00:08 +02:00
Aldo Cortesi
9abdd3a8d9
Move server playback in to an addon
...
- Move server playback into an addon
- Implement a better sync strategy to decide when to exit if keepserving is
off. We now wait for the final flow played back to no longer be live.
- Leave interactive server playback in mitmproxy console broken for now - there
are broader addon-related changes that need to be made for that, and this patch
is already big.
Fixes #1229
2016-09-06 23:48:02 +12:00
Schamper
85e1539d0a
Add test
2016-09-06 11:07:50 +02:00
Thomas Kriechbaumer
c0b12da401
change test value
2016-09-04 09:31:45 +02:00
Thomas Kriechbaumer
4c7f99d2be
improve netlib.encoding
2016-09-04 09:31:44 +02:00
Thomas Kriechbaumer
69b770469e
http2: assemble connect-request from object
2016-09-03 12:31:35 +02:00
Thomas Kriechbaumer
ea2a51d3be
http2: fixes
2016-09-03 11:50:37 +02:00
Thomas Kriechbaumer
5dda9505b6
http2: improve framereader
2016-09-03 10:00:31 +02:00
Thomas Kriechbaumer
0badb3ec91
cleanup
2016-09-03 10:00:31 +02:00
Thomas Kriechbaumer
0d0c2c788d
cleanup tests
2016-09-01 10:12:13 +02:00
Thomas Kriechbaumer
e5b0dae7e9
add websockets support to mitmproxy
2016-09-01 09:57:18 +02:00
Thomas Kriechbaumer
d12515f84b
websockets: refactor implementation and add tests
2016-09-01 09:56:14 +02:00
arjun23496
a8deed1f4e
Lint fix - minor
2016-08-31 16:39:04 +05:30
arjun23496
2476809ff8
Lint fix - replace tests
2016-08-31 16:27:22 +05:30
arjun23496
d2cfa5ca41
Added tests for replace in request,message,header
2016-08-31 10:23:33 +05:30
Manish Kumar
2cf4efab07
fixing lint error
2016-08-26 14:22:02 +05:30
Manish Kumar
16401d5be8
fixed : Divide by zero error came when string was empty, also a test
2016-08-26 12:52:51 +05:30
Thomas Kriechbaumer
51771c01c6
allow test classes to dynamically specify ssl context
2016-08-24 09:19:42 +02:00
Maximilian Hils
f27028f58e
introduce Response.make for simple response creation
2016-08-23 00:17:06 -07:00
Thomas Kriechbaumer
eb83107e1c
reenable options test
2016-08-16 11:05:57 +02:00
Thomas Kriechbaumer
cd35a6ff47
add regression test for #1476
2016-08-16 11:05:57 +02:00
Thomas Kriechbaumer
bfe22e739c
Merge pull request #1481 from Kriechi/http2-simplify-zombies
...
http2: simplify zombie detection
2016-08-16 10:10:39 +02:00
Thomas Kriechbaumer
17c65e46cb
Merge pull request #1480 from mhils/reverse-proxy-auth
...
Add basic auth support for reverse proxy mode
2016-08-16 10:07:59 +02:00
Shadab Zafar
239eaf0078
Remove timezone specific value
2016-08-15 15:05:32 +05:30
Shadab Zafar
bc175b58f2
Use test times less than 2038
...
So that tests pass on 32bit systems too
2016-08-15 12:00:23 +05:30
Shadab Zafar
ec0bae35c5
Assert cookie groups explicitly rather than just the length
2016-08-15 12:00:23 +05:30
Shadab Zafar
b9426fcec1
Add a test for base64 encoding
2016-08-15 12:00:23 +05:30
Shadab Zafar
988174246b
Add some cookie formatting related tests
2016-08-15 12:00:23 +05:30
Shadab Zafar
456f80d862
Open JSON file in text mode
2016-08-15 12:00:23 +05:30
Shadab Zafar
03e6117042
Add a function to get cookie expiration time
2016-08-15 12:00:23 +05:30
Shadab Zafar
a479c51465
Add method to group pairs by cookies
2016-08-15 12:00:23 +05:30
Shadab Zafar
99b32094d8
Add simple har_dump test
2016-08-15 12:00:23 +05:30
Thomas Kriechbaumer
8f4baf42ea
http2: cleanup
2016-08-14 13:06:33 +02:00
Maximilian Hils
a9401472cd
add basic auth support for reverse proxy mode
2016-08-13 11:04:53 -07:00
Maximilian Hils
5a22496ee8
clean up code, improve DummyReply
2016-08-09 22:29:07 -07:00
Maximilian Hils
818840f553
finalize Reply semantics, fix tests
2016-08-09 20:26:24 -07:00
Maximilian Hils
dcfa7027ae
fix tests
2016-08-04 15:39:48 -07:00
Maximilian Hils
951885a5dd
simplify contentview logic
2016-08-04 15:23:44 -07:00
Maximilian Hils
7ea9726e5d
Merge pull request #1453 from dufferzafar/limit-to-filter
...
Rename "Limit" feature to "Filter View"
2016-07-31 23:13:31 -07:00
Aldo Cortesi
ca0eab0f05
Merge pull request #1447 from mitmproxy/secure-by-default
...
Verify upstream certificates by default
2016-08-01 14:44:16 +12:00
Shadab Zafar
10ad56c853
Rename "Limit" feature to "Filter View"
2016-07-31 16:54:09 +05:30
Maximilian Hils
ca2e338876
Merge pull request #1449 from mhils/fix-1448
...
Add escape_single_quotes=False arg to bytes_to_escaped_str
2016-07-30 15:56:55 -07:00
Angelo Agatino Nicolosi
6792ec4058
Integrated encode/decoder for brotli
2016-07-30 14:43:53 +02:00
Maximilian Hils
4534363671
add escape_single_quotes=False arg to bytes_to_escaped_str
2016-07-29 19:54:44 -07:00
dufferzafar
1cffa5f46b
Use replace while decoding
2016-07-28 07:48:10 -07:00
Maximilian Hils
f54b302a59
fix cert verification tests, remove leftovers
2016-07-27 22:44:06 -07:00
Maximilian Hils
8b325fd65a
improve invalid certificate ux
2016-07-27 21:01:28 -07:00
Sachin Kelkar
17fdb841f0
verify upstream certificates by default ( #1111 )
...
squashed and merged by @mhils
2016-07-27 17:57:38 -07:00
Maximilian Hils
013288f7ca
add quote/unquote tests
2016-07-24 19:38:44 -07:00
Maximilian Hils
e07f515a20
remove content caching in netlib.http.Message
2016-07-23 19:05:10 -07:00
Maximilian Hils
d6209fa03b
add tests for single-element cache
2016-07-23 19:04:57 -07:00
Maximilian Hils
a87d089561
Merge pull request #1380 from dufferzafar/marked-filter
...
Marked property and filter
2016-07-23 17:55:12 -07:00
Maximilian Hils
fa45722ed8
Merge pull request #1402 from mhils/console-fixes
...
minor fixes
2016-07-23 12:49:57 -07:00
Maximilian Hils
61de6fa1d6
fix test_view_urlencoded
2016-07-23 11:55:27 -07:00
Thomas Kriechbaumer
514ea1b701
http2: cleanup tests
2016-07-23 11:08:32 +02:00
Shadab Zafar
08000c940c
Test marked property while serialization roundtrip
2016-07-23 10:41:57 +05:30
Aldo Cortesi
afda175e1c
Addon iface: .configure(options) -> .configure(options, updated)
2016-07-23 15:43:55 +12:00
Aldo Cortesi
b5416895f5
script: convert test recorder to an addon class
2016-07-23 11:38:45 +12:00
Aldo Cortesi
9294d19f90
scripts: .start can now return an Addon instance
2016-07-23 11:29:13 +12:00
Aldo Cortesi
51a8ba57f1
script: add a namespace adaptor to match Addons
2016-07-23 11:03:50 +12:00
Maximilian Hils
65c2f30218
fix mitmproxy 0.11 dumpfile - was 0.18 before
2016-07-22 10:36:26 -07:00
Maximilian Hils
798759d2b3
fix content view cache invalidation
2016-07-21 19:49:32 -07:00
Aldo Cortesi
33ffbc28ed
console: share one ActionBar instance
...
This fixes an issues where popping a view off the stack caused stale ActionBar
contents to be displayed.
2016-07-21 15:41:43 +12:00
Aldo Cortesi
6750ab899a
Merge branch 'flow-export' of https://github.com/dufferzafar/mitmproxy into dufferzafar-flow-export
2016-07-21 13:53:41 +12:00
Aldo Cortesi
02acfb1242
Fix netlib.utils.is_valid_host
...
- Don't crash when passed an empty string. This translated into an actual core
crash, discovered while fuzzing with afl.
- Taking a slice of length one out of bytes returns an integer, so the check
for trailing period in this function never worked on Python3.
- Add unit tests.
2016-07-21 10:38:37 +12:00
Shadab Zafar
c84d0bd10b
Add a url exporter
2016-07-20 10:03:00 +05:30
Shadab Zafar
8f4d49e22a
Remove raw_request exporter
...
This functionality will be handled by headers+content
2016-07-20 10:03:00 +05:30
Aldo Cortesi
8317772377
mitproxy.options -> mitmproxy.optmanager, mitmproxy.flow.options -> mitmproxy.options
...
It might be slightly more felicitous to move optmanager into netlib at some
point, especially if we can also use it in pathod.
This also consolidates our constants in mitmproxy.options, removing some duplicates.
2016-07-20 11:28:53 +12:00
Aldo Cortesi
09fbebf42a
Test suite: get_proxy_config -> get_options
2016-07-19 19:36:40 +12:00
Aldo Cortesi
9c9d28d068
Remove proxy.config.process_proxy_options
2016-07-19 16:25:09 +12:00
Aldo Cortesi
ef380917a8
ProxyConf: adapt mitmproxy console, ditch tcp|host filter attrs on flow.master
2016-07-19 16:25:09 +12:00
Aldo Cortesi
be081a24bc
ProxyConf: auth_* into Options
2016-07-19 16:25:09 +12:00
Aldo Cortesi
5cfe783b6c
ProxyConfig: http2, rawtcp, no_upstream_cert -> Options
2016-07-19 16:25:09 +12:00
Aldo Cortesi
26fa88a338
ProxyConfig: Refactor to move verification mode checks into configure
2016-07-19 16:25:09 +12:00
Aldo Cortesi
98bf544664
Regularize naming of upstream_trusted_ca* options
2016-07-19 16:25:09 +12:00
Aldo Cortesi
0a3839375d
ProxyConfig: various SSL options to Options
2016-07-19 16:25:09 +12:00
Aldo Cortesi
78e8159007
config.parse_server_spec shouldn't pass byts to tcp.Address
2016-07-19 16:25:09 +12:00
Aldo Cortesi
f9622074cc
ProxyConfig: mode, upstream_server and upstream_auth to Options
2016-07-19 16:25:09 +12:00
Aldo Cortesi
d2268ddb1e
ProxyConfig: --body-size-limit to Options
2016-07-19 16:25:09 +12:00
Aldo Cortesi
856e1c2ba9
Move clientcers & cadir to Options
...
Also adds a .configure mechanism to ProxyConfig, and hooks it up to the change
event.
2016-07-19 16:25:09 +12:00
Aldo Cortesi
b1b1a1b9cf
ProxyConfig: cadir to options
2016-07-19 16:25:09 +12:00
Aldo Cortesi
6908dc4d90
ProxyConfig refactor
...
Step two of frog boiling: move listening address and port into options. This is
the hard bit, because it touches the test suite so deeply.
2016-07-19 16:25:09 +12:00
Aldo Cortesi
9bc1514aef
Unify proxy config and options
...
This is step 1 in a gradual "boiling frog" strategy. Decorate ProxyConfig
with an Options object.
2016-07-19 16:25:09 +12:00
Aldo Cortesi
e9865800a8
Console options cleanup
...
Use setters, use togglers, move more things out of master
2016-07-18 10:31:34 +12:00
Aldo Cortesi
f9e4249499
Add a toggller helper to Options, start using it in mitmproxy console
2016-07-18 10:03:10 +12:00
Thomas Kriechbaumer
7b57c2948e
cleanup
2016-07-17 18:17:35 +02:00
Thomas Kriechbaumer
d9021f8505
http2: coverage++
2016-07-17 18:07:02 +02:00
Aldo Cortesi
216e38d437
setheaders -> addon
2016-07-17 18:41:14 +12:00
Aldo Cortesi
a26cc75aab
Merge pull request #1370 from cortesi/filestreamer
...
Some work on stream-to-file
2016-07-17 16:20:41 +12:00
Aldo Cortesi
9bf1d300d8
Some work on stream-to-file
...
- stream -> filestreamer throughout
- move active_flows set into FileStreamer addon
2016-07-17 16:07:29 +12:00
Aldo Cortesi
fb45d59c02
Merge pull request #1367 from Kriechi/fix-1366
...
fix-1366
2016-07-17 15:06:58 +12:00
Aldo Cortesi
08b3af98c2
Merge branch 'master' into dumper
2016-07-17 12:53:14 +12:00
Aldo Cortesi
b0b3b19ad6
Extract console dump functionality into an addon
...
This removes all the code that deals with printing flows to screen from dump.py
into a self-contained addon.
- This fixes a bug - by moving dumping into an
addon, we now dump flows AFTER addon transformation, so we can see the changes
made.
- We get dumping "for free" in other places by simply adding the addon. It's
now easy to add dumping to console to mitmweb for debugging and development.
The same goes for external projects that derive from master.
- We also get major benefits in clarity for a frankly hairy part of our
project. Mitmdump is much clearer, and all the hairyness is now isolated for
further refactoring.
2016-07-17 10:17:02 +12:00
Thomas Kriechbaumer
a32312cecc
fix-1366
2016-07-16 18:31:37 +02:00
Maximilian Hils
afc3f6d854
Merge remote-tracking branch 'duffer/tcpflow-filter'
2016-07-16 00:19:01 -07:00
Maximilian Hils
b27d59095d
Merge pull request #1306 from mitmproxy/message-body-encoding
...
Improve Message Body Encoding
2016-07-16 00:13:58 -07:00
Maximilian Hils
e6e39ce80f
preserve content-type parameter order
2016-07-15 23:46:12 -07:00
Aldo Cortesi
1a1f7e6fd9
replacehooks -> addon
...
Also fixes a bug in header replacements in netlib that resulted in a mutable
multidict.
2016-07-16 18:37:30 +12:00