mitmproxy/docs/config.rst

87 lines
1.9 KiB
ReStructuredText
Raw Normal View History

2015-09-05 18:15:35 +00:00
.. _config:
Configuration
2015-09-05 21:50:37 +00:00
=============
Mitmproxy is configured through a set of files in the users ~/.mitmproxy
directory.
mitmproxy.conf
2015-09-07 08:52:18 +00:00
Settings for the :program:`mitmproxy`. This file can contain any options supported by
mitmproxy.
2015-09-05 21:50:37 +00:00
mitmdump.conf
2015-09-07 08:52:18 +00:00
Settings for the :program:`mitmdump`. This file can contain any options supported by mitmdump.
2015-09-05 21:50:37 +00:00
common.conf
2015-09-07 08:52:18 +00:00
Settings shared between all command-line tools. Settings in this file are over-ridden by those
in the tool-specific files. Only options shared by mitmproxy and mitmdump should be used in
this file.
2015-09-05 21:50:37 +00:00
Syntax
------
Comments
^^^^^^^^
.. code-block:: none
2015-09-07 08:52:18 +00:00
# this is a comment
; this is also a comment (.ini style)
--- and this is a comment too (yaml style)
2015-09-05 21:50:37 +00:00
Key/Value pairs
^^^^^^^^^^^^^^^
- Keys and values are case-sensitive
- Whitespace is ignored
- Lists are comma-delimited, and enclosed in square brackets
.. code-block:: none
2015-09-07 08:52:18 +00:00
name = value # (.ini style)
name: value # (yaml style)
--name value # (command-line option style)
2015-09-05 21:50:37 +00:00
2015-09-07 08:52:18 +00:00
fruit = [apple, orange, lemon]
indexes = [1, 12, 35 , 40]
2015-09-05 21:50:37 +00:00
Flags
^^^^^
These are boolean options that take no value but true/false.
.. code-block:: none
2015-09-07 08:52:18 +00:00
name = true # (.ini style)
name
--name # (command-line option style)
2015-09-05 21:50:37 +00:00
Options
-------
The options available in the config files are precisely those available as
command-line flags, with the key being the option's long name. To get a
complete list of these, use the :option:`--help` option on each of the tools. Be
careful to only specify common options in the **common.conf** file -
unsupported options in this file will be detected as an error on startup.
Examples
--------
common.conf
^^^^^^^^^^^
Note that :option:`--port` is an option supported by all tools.
.. code-block:: none
2015-09-07 08:52:18 +00:00
port = 8080
2015-09-05 21:50:37 +00:00
mitmproxy.conf
^^^^^^^^^^^^^^
.. code-block:: none
2015-09-07 08:52:18 +00:00
palette = light