aboutsummaryrefslogtreecommitdiffstats
path: root/docs/scripting/inlinescripts.rst
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-07-08 20:11:12 -0700
committerGitHub <noreply@github.com>2016-07-08 20:11:12 -0700
commit15c10d49f6b020c5b913ae5b5e8c4b923a507a47 (patch)
treeb13eb4f3ec88fa90b515edcf4323363124dcd995 /docs/scripting/inlinescripts.rst
parentf7639e077ab10dc8e7f180f44b531b9ad35c060b (diff)
parent5d2b7c52f9c33e84be5c4330b09b0f2a5ad869e2 (diff)
downloadmitmproxy-15c10d49f6b020c5b913ae5b5e8c4b923a507a47.tar.gz
mitmproxy-15c10d49f6b020c5b913ae5b5e8c4b923a507a47.tar.bz2
mitmproxy-15c10d49f6b020c5b913ae5b5e8c4b923a507a47.zip
Merge pull request #1327 from mitmproxy/remove-script-context
Remove script context
Diffstat (limited to 'docs/scripting/inlinescripts.rst')
-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
---------------------------