aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/proxy
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2015-09-03 18:55:38 +0200
committerMaximilian Hils <git@maximilianhils.com>2015-09-03 18:55:38 +0200
commit14457f29b3d89e234d0791c4980e5cf9514185dd (patch)
tree9a12632fea816eb5a7f701d3e92670dc4009ccfe /libmproxy/proxy
parent99126f62ed947847eba4cfa687cb0b0f012092bb (diff)
downloadmitmproxy-14457f29b3d89e234d0791c4980e5cf9514185dd.tar.gz
mitmproxy-14457f29b3d89e234d0791c4980e5cf9514185dd.tar.bz2
mitmproxy-14457f29b3d89e234d0791c4980e5cf9514185dd.zip
docs++
Diffstat (limited to 'libmproxy/proxy')
-rw-r--r--libmproxy/proxy/root_context.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/libmproxy/proxy/root_context.py b/libmproxy/proxy/root_context.py
index 88df8e47..87a540c0 100644
--- a/libmproxy/proxy/root_context.py
+++ b/libmproxy/proxy/root_context.py
@@ -11,21 +11,31 @@ from .modes import HttpProxy, HttpUpstreamProxy, ReverseProxy
class RootContext(object):
"""
- The outmost context provided to the root layer.
- As a consequence, every layer has .client_conn, .channel, .next_layer() and .config.
+ The outermost context provided to the root layer.
+ As a consequence, every layer has access to methods and attributes defined here.
+
+ Attributes:
+ client_conn:
+ The :py:class:`client connection <libmproxy.models.ClientConnection>`.
+ channel:
+ A :py:class:`~libmproxy.controller.Channel` to communicate with the FlowMaster.
+ Provides :py:meth:`.ask() <libmproxy.controller.Channel.ask>` and
+ :py:meth:`.tell() <libmproxy.controller.Channel.tell>` methods.
+ config:
+ The :py:class:`proxy server's configuration <libmproxy.proxy.ProxyConfig>`
"""
def __init__(self, client_conn, config, channel):
- self.client_conn = client_conn # Client Connection
- self.channel = channel # provides .ask() method to communicate with FlowMaster
- self.config = config # Proxy Configuration
+ self.client_conn = client_conn
+ self.channel = channel
+ self.config = config
def next_layer(self, top_layer):
"""
This function determines the next layer in the protocol stack.
Arguments:
- top_layer: the current top layer.
+ top_layer: the current innermost layer.
Returns:
The next layer