aboutsummaryrefslogtreecommitdiffstats
path: root/docs/scripting
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-07-07 23:50:55 -0700
committerMaximilian Hils <git@maximilianhils.com>2016-07-07 23:50:55 -0700
commit7c67faa8da39f428d1860bccae806137943b66a6 (patch)
tree67d4eb8297b901386d0b91ebc0cb55d1463adf8f /docs/scripting
parentc048ae1d5b652ad4778917e624ace217e1ecfd91 (diff)
downloadmitmproxy-7c67faa8da39f428d1860bccae806137943b66a6.tar.gz
mitmproxy-7c67faa8da39f428d1860bccae806137943b66a6.tar.bz2
mitmproxy-7c67faa8da39f428d1860bccae806137943b66a6.zip
remove script contexts
Diffstat (limited to 'docs/scripting')
-rw-r--r--docs/scripting/inlinescripts.rst23
1 files changed, 4 insertions, 19 deletions
diff --git a/docs/scripting/inlinescripts.rst b/docs/scripting/inlinescripts.rst
index 1ee44972..bc9d5ff5 100644
--- a/docs/scripting/inlinescripts.rst
+++ b/docs/scripting/inlinescripts.rst
@@ -15,9 +15,7 @@ client:
:caption: examples/add_header.py
:language: python
-The first argument to each event method is an instance of
-:py:class:`~mitmproxy.script.ScriptContext` that lets the script interact with the global mitmproxy
-state. The **response** event also gets an instance of :py:class:`~mitmproxy.models.HTTPFlow`,
+All events that deal with an HTTP request get an instance of :py:class:`~mitmproxy.models.HTTPFlow`,
which we can use to manipulate the response itself.
We can now run this script using mitmdump or mitmproxy as follows:
@@ -36,11 +34,6 @@ We encourage you to either browse them locally or on `GitHub`_.
Events
------
-The ``context`` argument passed to each event method is always a
-:py:class:`~mitmproxy.script.ScriptContext` instance. It is guaranteed to be the same object
-for the scripts lifetime and is not shared between multiple inline scripts. You can safely use it
-to store any form of state you require.
-
Script Lifecycle Events
^^^^^^^^^^^^^^^^^^^^^^^
@@ -155,8 +148,9 @@ The canonical API documentation is the code, which you can browse here, locally
The main classes you will deal with in writing mitmproxy scripts are:
-:py:class:`~mitmproxy.script.ScriptContext`
- - A handle for interacting with mitmproxy's Flow Master from within scripts.
+:py:class:`mitmproxy.flow.FlowMaster`
+ - The "heart" of mitmproxy, usually subclassed as :py:class:`mitmproxy.dump.DumpMaster` or
+ :py:class:`mitmproxy.console.ConsoleMaster`.
:py:class:`~mitmproxy.models.ClientConnection`
- Describes a client connection.
:py:class:`~mitmproxy.models.ServerConnection`
@@ -173,16 +167,7 @@ The main classes you will deal with in writing mitmproxy scripts are:
- A dictionary-like object for managing HTTP headers.
:py:class:`netlib.certutils.SSLCert`
- Exposes information SSL certificates.
-:py:class:`mitmproxy.flow.FlowMaster`
- - The "heart" of mitmproxy, usually subclassed as :py:class:`mitmproxy.dump.DumpMaster` or
- :py:class:`mitmproxy.console.ConsoleMaster`.
-
-Script Context
---------------
-.. autoclass:: mitmproxy.script.ScriptContext
- :members:
- :undoc-members:
Running scripts in parallel
---------------------------