aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/models
diff options
context:
space:
mode:
Diffstat (limited to 'mitmproxy/models')
-rw-r--r--mitmproxy/models/connections.py6
-rw-r--r--mitmproxy/models/http.py9
-rw-r--r--mitmproxy/models/tcp.py2
3 files changed, 12 insertions, 5 deletions
diff --git a/mitmproxy/models/connections.py b/mitmproxy/models/connections.py
index 91590bca..24cdff74 100644
--- a/mitmproxy/models/connections.py
+++ b/mitmproxy/models/connections.py
@@ -10,6 +10,7 @@ from .. import stateobject, utils
class ClientConnection(tcp.BaseHandler, stateobject.StateObject):
+
"""
A client connection
@@ -21,6 +22,7 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject):
timestamp_ssl_setup: TLS established timestamp
timestamp_end: Connection end timestamp
"""
+
def __init__(self, client_connection, address, server):
# Eventually, this object is restored from state. We don't have a
# connection then.
@@ -101,6 +103,7 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject):
class ServerConnection(tcp.TCPClient, stateobject.StateObject):
+
"""
A server connection
@@ -117,6 +120,7 @@ class ServerConnection(tcp.TCPClient, stateobject.StateObject):
timestamp_ssl_setup: TLS established timestamp
timestamp_end: Connection end timestamp
"""
+
def __init__(self, address, source_address=None):
tcp.TCPClient.__init__(self, address, source_address)
@@ -182,7 +186,7 @@ class ServerConnection(tcp.TCPClient, stateobject.StateObject):
timestamp_ssl_setup=None,
timestamp_end=None,
via=None
- ))
+ ))
def copy(self):
return copy.copy(self)
diff --git a/mitmproxy/models/http.py b/mitmproxy/models/http.py
index 75ffbfd0..43618ef8 100644
--- a/mitmproxy/models/http.py
+++ b/mitmproxy/models/http.py
@@ -72,9 +72,9 @@ class HTTPRequest(MessageMixin, Request):
def get_state(self):
state = super(HTTPRequest, self).get_state()
state.update(
- stickycookie = self.stickycookie,
- stickyauth = self.stickyauth,
- is_replay = self.is_replay,
+ stickycookie=self.stickycookie,
+ stickyauth=self.stickyauth,
+ is_replay=self.is_replay,
)
return state
@@ -109,6 +109,7 @@ class HTTPRequest(MessageMixin, Request):
class HTTPResponse(MessageMixin, Response):
+
"""
A mitmproxy HTTP response.
This is a very thin wrapper on top of :py:class:`netlib.http.Response` and
@@ -124,7 +125,7 @@ class HTTPResponse(MessageMixin, Response):
content,
timestamp_start=None,
timestamp_end=None,
- is_replay = False
+ is_replay=False
):
Response.__init__(
self,
diff --git a/mitmproxy/models/tcp.py b/mitmproxy/models/tcp.py
index 7e966b95..b87a74ac 100644
--- a/mitmproxy/models/tcp.py
+++ b/mitmproxy/models/tcp.py
@@ -6,6 +6,7 @@ from .flow import Flow
class TCPMessage(Serializable):
+
def __init__(self, from_client, content, timestamp=None):
self.content = content
self.from_client = from_client
@@ -33,6 +34,7 @@ class TCPMessage(Serializable):
class TCPFlow(Flow):
+
"""
A TCPFlow is a simplified representation of a TCP session.
"""