diff options
-rw-r--r-- | docs/_static/theme_overrides.css | 4 | ||||
-rw-r--r-- | docs/certinstall.rst | 2 | ||||
-rw-r--r-- | docs/conf.py | 31 | ||||
-rw-r--r-- | docs/dev/exceptions.rst | 9 | ||||
-rw-r--r-- | docs/dev/protocols.rst | 17 | ||||
-rw-r--r-- | docs/dev/proxy.rst | 12 | ||||
-rw-r--r-- | docs/index.rst | 3 | ||||
-rw-r--r-- | docs/scripting/inlinescripts.rst | 3 | ||||
-rw-r--r-- | mitmproxy/builtins/clientplayback.py | 1 | ||||
-rw-r--r-- | mitmproxy/console/master.py | 8 | ||||
-rw-r--r-- | mitmproxy/console/window.py | 20 | ||||
-rw-r--r-- | mitmproxy/protocol/__init__.py | 21 |
12 files changed, 32 insertions, 99 deletions
diff --git a/docs/_static/theme_overrides.css b/docs/_static/theme_overrides.css index 63c7cc78..585fdddb 100644 --- a/docs/_static/theme_overrides.css +++ b/docs/_static/theme_overrides.css @@ -9,3 +9,7 @@ max-width: 100%; overflow: visible; } + +.wy-menu-vertical header, .wy-menu-vertical p.caption { + color: #e0e0e0; +} diff --git a/docs/certinstall.rst b/docs/certinstall.rst index f5b92aeb..68ad59cc 100644 --- a/docs/certinstall.rst +++ b/docs/certinstall.rst @@ -135,7 +135,7 @@ mitmproxy. Mitmproxy then uses the provided certificate for interception of the specified domains instead of generating a certificate signed by its own CA. The certificate file is expected to be in the PEM format. You can include -intermediary certificates right below your leaf certificate, so that you PEM +intermediary certificates right below your leaf certificate, so that your PEM file roughly looks like this: .. code-block:: none diff --git a/docs/conf.py b/docs/conf.py index ae657435..54a353ac 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,37 +1,8 @@ -# -*- coding: utf-8 -*- -# -# mitmproxy documentation build configuration file, created by -# sphinx-quickstart on Thu Sep 03 14:04:13 2015. -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - import sys import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('..')) - import netlib.version -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. - extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', @@ -61,7 +32,7 @@ master_doc = 'index' # General information about the project. project = u'mitmproxy docs' -copyright = u'2015, the mitmproxy project' +copyright = u'2016, the mitmproxy project' author = u'The mitmproxy project' # The version info for the project you're documenting, acts as replacement for diff --git a/docs/dev/exceptions.rst b/docs/dev/exceptions.rst deleted file mode 100644 index e890476b..00000000 --- a/docs/dev/exceptions.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. _exceptions: - -Exceptions -========== - -.. automodule:: mitmproxy.exceptions - :show-inheritance: - :members: - :undoc-members: diff --git a/docs/dev/protocols.rst b/docs/dev/protocols.rst deleted file mode 100644 index ee368131..00000000 --- a/docs/dev/protocols.rst +++ /dev/null @@ -1,17 +0,0 @@ -.. _protocols: - -Protocols -========= - -.. automodule:: mitmproxy.protocol - - .. autoclass:: Layer - :members: - :special-members: - - .. autoclass:: ServerConnectionMixin - :members: - -.. seealso:: - - The :py:exc:`Kill <mitmproxy.exceptions.Kill>` exception to terminate connections.
\ No newline at end of file diff --git a/docs/dev/proxy.rst b/docs/dev/proxy.rst deleted file mode 100644 index 888fb946..00000000 --- a/docs/dev/proxy.rst +++ /dev/null @@ -1,12 +0,0 @@ -.. _proxy: - -Proxy Server -============ - -.. automodule:: mitmproxy.proxy - - .. autoclass:: ProxyServer - .. autoclass:: DummyServer - .. autoclass:: ProxyConfig - .. autoclass:: RootContext - :members: diff --git a/docs/index.rst b/docs/index.rst index 28c0c66f..143f79f7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -82,9 +82,6 @@ dev/architecture dev/testing dev/sslkeylogfile - dev/protocols - dev/proxy - dev/exceptions .. Indices and tables ================== diff --git a/docs/scripting/inlinescripts.rst b/docs/scripting/inlinescripts.rst index e1c01b17..5e56e01e 100644 --- a/docs/scripting/inlinescripts.rst +++ b/docs/scripting/inlinescripts.rst @@ -58,8 +58,7 @@ Connection Events .. versionchanged:: 0.14 - :param Layer root_layer: The root layer (see :ref:`protocols` for an explanation what the root - layer is), which provides transparent access to all attributes of the + :param Layer root_layer: The root layer, which provides transparent access to all attributes of the :py:class:`~mitmproxy.proxy.RootContext`. For example, ``root_layer.client_conn.address`` gives the remote address of the connecting client. diff --git a/mitmproxy/builtins/clientplayback.py b/mitmproxy/builtins/clientplayback.py index c40d1904..75ef2ffd 100644 --- a/mitmproxy/builtins/clientplayback.py +++ b/mitmproxy/builtins/clientplayback.py @@ -19,6 +19,7 @@ class ClientPlayback: def configure(self, options, updated): if "client_replay" in updated: if options.client_replay: + ctx.log.info(options.client_replay) try: flows = flow.read_flows_from_paths(options.client_replay) except exceptions.FlowReadException as e: diff --git a/mitmproxy/console/master.py b/mitmproxy/console/master.py index febf46c5..6652bf0c 100644 --- a/mitmproxy/console/master.py +++ b/mitmproxy/console/master.py @@ -635,14 +635,6 @@ class ConsoleMaster(flow.FlowMaster): def edit_scripts(self, scripts): self.options.scripts = [x[0] for x in scripts] - def stop_client_playback_prompt(self, a): - if a != "n": - self.stop_client_playback() - - def stop_server_playback_prompt(self, a): - if a != "n": - self.stop_server_playback() - def quit(self, a): if a != "n": raise urwid.ExitMainLoop diff --git a/mitmproxy/console/window.py b/mitmproxy/console/window.py index 159f68ed..ab2c80ad 100644 --- a/mitmproxy/console/window.py +++ b/mitmproxy/console/window.py @@ -40,13 +40,11 @@ class Window(urwid.Frame): def handle_replay(self, k): if k == "c": - if not self.master.client_playback: - signals.status_prompt_path.send( - self, - prompt = "Client replay path", - callback = self.master.client_playback_path - ) - else: + creplay = self.master.addons.get("clientplayback") + if self.master.options.client_replay and creplay.count(): + def stop_client_playback_prompt(a): + if a != "n": + self.master.options.client_replay = None signals.status_prompt_onekey.send( self, prompt = "Stop current client replay?", @@ -54,7 +52,13 @@ class Window(urwid.Frame): ("yes", "y"), ("no", "n"), ), - callback = self.master.stop_client_playback_prompt, + callback = stop_client_playback_prompt + ) + else: + signals.status_prompt_path.send( + self, + prompt = "Client replay path", + callback = lambda x: self.master.options.setter("client_replay")([x]) ) elif k == "s": a = self.master.addons.get("serverplayback") diff --git a/mitmproxy/protocol/__init__.py b/mitmproxy/protocol/__init__.py index b99b55bd..5bf259ae 100644 --- a/mitmproxy/protocol/__init__.py +++ b/mitmproxy/protocol/__init__.py @@ -1,8 +1,9 @@ """ -In mitmproxy, protocols are implemented as a set of layers, which are composed on top each other. -The first layer is usually the proxy mode, e.g. transparent proxy or normal HTTP proxy. Next, -various protocol layers are stacked on top of each other - imagine WebSockets on top of an HTTP -Upgrade request. An actual mitmproxy connection may look as follows (outermost layer first): +In mitmproxy, protocols are implemented as a set of layers, which are composed +on top each other. The first layer is usually the proxy mode, e.g. transparent +proxy or normal HTTP proxy. Next, various protocol layers are stacked on top of +each other - imagine WebSockets on top of an HTTP Upgrade request. An actual +mitmproxy connection may look as follows (outermost layer first): Transparent HTTP proxy, no TLS: - TransparentProxy @@ -16,13 +17,15 @@ Upgrade request. An actual mitmproxy connection may look as follows (outermost l - TLSLayer - WebsocketLayer (or TCPLayer) -Every layer acts as a read-only context for its inner layers (see :py:class:`Layer`). To communicate -with an outer layer, a layer can use functions provided in the context. The next layer is always -determined by a call to :py:meth:`.next_layer() <mitmproxy.proxy.RootContext.next_layer>`, +Every layer acts as a read-only context for its inner layers (see +:py:class:`Layer`). To communicate with an outer layer, a layer can use +functions provided in the context. The next layer is always determined by a +call to :py:meth:`.next_layer() <mitmproxy.proxy.RootContext.next_layer>`, which is provided by the root context. -Another subtle design goal of this architecture is that upstream connections should be established -as late as possible; this makes server replay without any outgoing connections possible. +Another subtle design goal of this architecture is that upstream connections +should be established as late as possible; this makes server replay without any +outgoing connections possible. """ from __future__ import absolute_import, print_function, division |