aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/docs/features/filters.rst
diff options
context:
space:
mode:
Diffstat (limited to 'mitmproxy/docs/features/filters.rst')
-rw-r--r--mitmproxy/docs/features/filters.rst39
1 files changed, 39 insertions, 0 deletions
diff --git a/mitmproxy/docs/features/filters.rst b/mitmproxy/docs/features/filters.rst
new file mode 100644
index 00000000..2adcfb70
--- /dev/null
+++ b/mitmproxy/docs/features/filters.rst
@@ -0,0 +1,39 @@
+.. _filters:
+
+Filter expressions
+==================
+
+Many commands in :program:`mitmproxy` and :program:`mitmdump` take a filter expression.
+Filter expressions consist of the following operators:
+
+.. documentedlist::
+ :header: "Expression" "Description"
+ :listobject: libmproxy.filt.help
+
+- Regexes are Python-style
+- Regexes can be specified as quoted strings
+- Header matching (~h, ~hq, ~hs) is against a string of the form "name: value".
+- Strings with no operators are matched against the request URL.
+- The default binary operator is &.
+
+Examples
+--------
+
+URL containing "google.com":
+
+.. code-block:: none
+
+ google\.com
+
+Requests whose body contains the string "test":
+
+.. code-block:: none
+
+ ~q ~b test
+
+Anything but requests with a text/html content type:
+
+.. code-block:: none
+
+ !(~q & ~t "text/html")
+