Maximilian Hils
f0c15aa09c
@mhils can't merge
2016-07-16 00:36:26 -07: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
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
Maximilian Hils
3602fd7a36
Merge remote-tracking branch 'origin/master' into message-body-encoding
2016-07-15 23:17:57 -07:00
Maximilian Hils
a3c7c84d49
improve message content semantics
2016-07-15 22:50:33 -07:00
Shadab Zafar
fea4435dac
Allow DummyFlow to match ~e, ~src and ~dst
2016-07-16 10:15:38 +05:30
Shadab Zafar
5082dc6cbd
Sort filt items alphabetically
2016-07-16 10:15:38 +05:30
Shadab Zafar
6a2668d865
Add ~http and ~tcp filters
2016-07-16 10:15:38 +05:30
Shadab Zafar
262a420553
Use ~bq / ~bs for messages sent from client / server
2016-07-16 10:15:38 +05:30
Shadab Zafar
5f7d61f864
Replace http decorator with one that handles different flowtypes
2016-07-16 10:15:38 +05:30
Shadab Zafar
a7bb0f5d02
Add TCPFlow.match
2016-07-16 10:15:38 +05:30
Shadab Zafar
ffcdd02e96
Add decorator for HTTPFlow filters
2016-07-16 10:15:38 +05:30
Shadab Zafar
124b87b851
Add test for body (~b)
2016-07-16 10:15:38 +05:30
Aldo Cortesi
17305643bc
console: don't let messages overwrite prompts
...
This renders mitmproxy unresponsive and is bad UX as well.
2016-07-16 11:48:16 +12:00
Aldo Cortesi
50f1495f29
Make mitmdump return an error exit status if errors occurred during run
2016-07-16 10:59:47 +12:00
Aldo Cortesi
33d03d916a
Flash a status bar message if an error log event occurs
2016-07-16 10:39:49 +12:00
Aldo Cortesi
49b65d2ea4
Add a helper to translate a log level to a tier
...
This is in utils for now - we'll find a better home down the track.
2016-07-16 10:33:50 +12:00
Aldo Cortesi
91e9016ce5
Trigger "start" when scripts are reloaded.
2016-07-16 10:21:00 +12:00
Aldo Cortesi
5f23d4f5ca
add_event -> add_log throughout project
...
"Event" is terribly over-loaded in the project, and "log" is straight-forward
and self-explanatory.
2016-07-16 10:19:06 +12:00
Aldo Cortesi
5a60f32c55
Fix log level handling
...
We have 4: error, warn, info and debug.
2016-07-16 09:23:52 +12:00
Aldo Cortesi
532ae7dc4a
Add addons after initialisation in mitmproxy console
...
The main effect of this is that we now properly capture errors on startup that
were ignored before.
2016-07-16 09:22:56 +12:00
Maximilian Hils
60d2e14cb9
fix #1358
2016-07-15 00:07:32 -07:00
Aldo Cortesi
c7d0850d8f
Script cleanups
...
- Preserve script order on config change
- Prohibit script duplicates (i.e. identical script + args)
- Various cleanups and tweaks
2016-07-15 16:35:24 +12:00
Aldo Cortesi
4ba7ce50c6
Add .start for addons and scripts
...
Also improve error messages, fix various unit tests
2016-07-15 14:52:34 +12:00
Aldo Cortesi
8fee5db675
Always use PollingObserver
2016-07-14 21:33:53 +12:00
Aldo Cortesi
9f1c46e7d6
Merge branch 'master' into script
2016-07-14 20:26:34 +12:00
Aldo Cortesi
e051928f26
Add missing mitmweb option
2016-07-14 20:24:56 +12:00
Aldo Cortesi
a4127fb6d5
Add a tick event for addons and scripts, and use it for race-free reload
2016-07-14 19:54:15 +12:00
Aldo Cortesi
5b2d1c044a
Tighten the tick loop
...
In the past, we consumed from the event queue until we were idle for a certain
amount of time (0.1s). This would cause hangs in interactive tools when there
was a stream of events, hurting responsiveness. We now wait for a maximum of
0.1s before triggering the tick loop, will be able to reduce this further down
the track.
2016-07-14 19:54:15 +12:00
Aldo Cortesi
deffed2196
Script cleanup: editing in console, Python3 compatibility fixes
2016-07-14 19:54:15 +12:00
Aldo Cortesi
b94f5fd361
Convert examples and example tests for new-style scripts
...
Remove the test that just loads all the example scripts for now - it's a very
low-value test, and we need to think of something better.
2016-07-14 19:54:15 +12:00
Aldo Cortesi
a6821aad8e
Zap old scripts infrastructure, fix concurrency tests
2016-07-14 19:54:15 +12:00
Aldo Cortesi
a3a22fba33
First-order integration of scripts addon
2016-07-14 19:54:15 +12:00
Shadab Zafar
1266255842
Re-add deletion of stickycookies ( #1355 )
...
This was originally added in #1324 (fixing issue #1096 )
but got lost during "the big refactor" (#1352 )
2016-07-14 00:37:27 -07:00
Maximilian Hils
f84a23f11d
minor fixes
2016-07-13 22:01:16 -07:00
Maximilian Hils
ec6fbe9eb6
make options explicit
2016-07-13 21:45:25 -07:00
Aldo Cortesi
b2c4f301cb
Stream to file -> addon
...
This commit also clarifies a confusion about the "outfile" attribute and its
use in testing in the mitmdump master.
2016-07-14 13:52:09 +12:00
Aldo Cortesi
cf3b3d206a
Zap unused imports
2016-07-14 12:45:00 +12:00
Aldo Cortesi
120465a142
Ditch StickyCookie module
2016-07-14 12:17:28 +12:00
Aldo Cortesi
00509d86a8
StickyCookies to addon
2016-07-14 12:13:14 +12:00
Aldo Cortesi
143bf0dfa9
AntiCache to addon
2016-07-14 11:24:06 +12:00
Aldo Cortesi
97b2e6d958
Add a .setter helper to Options
...
This returns a function that sets a named attribute, and is handy for
event-driven code like mitmproxy console.
2016-07-14 11:11:41 +12:00
Aldo Cortesi
c52d567b43
Handle OptionsError for command-line args.
2016-07-14 10:19:16 +12:00
Aldo Cortesi
a8a083a10d
Move StickyAuth into addon
...
This is the first addon that handles an OptionsError, so this commit also demos
how this works in console. Handling of command-line erorrs is on its way.
2016-07-14 10:08:41 +12:00
Aldo Cortesi
696789b8ec
func.__name__ works in both 2.7 and 3.5
...
Thanks to @resam and @dwfreed for pointing this out
2016-07-14 09:33:26 +12:00
Aldo Cortesi
9ab1db513f
Satisfy our ruthless linting overlords
2016-07-13 23:50:25 +12:00
Aldo Cortesi
255e1eb00b
Add the addons mechanism
...
Demonstrate how it works and interacts with Options by adding our first new
builtin: anticomp.
2016-07-13 23:45:49 +12:00
Aldo Cortesi
7f8fd3cdff
Basic outline of addons
...
Add addons.py, integrate with our event mechanism, and change the Master API so
options is the first init argument.
2016-07-13 23:26:04 +12:00
Aldo Cortesi
c9a0fe6a0e
Show how options integrates with console
...
This is not functional at the moment, because all mutable options are still on
master.
2016-07-13 19:15:38 +12:00