diff options
Diffstat (limited to 'libmproxy/models')
-rw-r--r-- | libmproxy/models/connections.py | 4 | ||||
-rw-r--r-- | libmproxy/models/flow.py | 2 | ||||
-rw-r--r-- | libmproxy/models/http.py | 5 |
3 files changed, 9 insertions, 2 deletions
diff --git a/libmproxy/models/connections.py b/libmproxy/models/connections.py index f5dabe4e..a45e1629 100644 --- a/libmproxy/models/connections.py +++ b/libmproxy/models/connections.py @@ -8,6 +8,7 @@ from .. import stateobject, utils class ClientConnection(tcp.BaseHandler, stateobject.StateObject): + def __init__(self, client_connection, address, server): # Eventually, this object is restored from state. We don't have a # connection then. @@ -88,6 +89,7 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject): class ServerConnection(tcp.TCPClient, stateobject.StateObject): + def __init__(self, address, source_address=None): tcp.TCPClient.__init__(self, address, source_address) @@ -134,7 +136,7 @@ class ServerConnection(tcp.TCPClient, stateobject.StateObject): d = super(ServerConnection, self).get_state(short) d.update( address=({"address": self.address(), - "use_ipv6": self.address.use_ipv6} if self.address else {}), + "use_ipv6": self.address.use_ipv6} if self.address else {}), source_address=({"address": self.source_address(), "use_ipv6": self.source_address.use_ipv6} if self.source_address else None), cert=self.cert.to_pem() if self.cert else None diff --git a/libmproxy/models/flow.py b/libmproxy/models/flow.py index 8eff18f4..b4e8cb88 100644 --- a/libmproxy/models/flow.py +++ b/libmproxy/models/flow.py @@ -7,6 +7,7 @@ from .connections import ClientConnection, ServerConnection class Error(stateobject.StateObject): + """ An Error. @@ -53,6 +54,7 @@ class Error(stateobject.StateObject): class Flow(stateobject.StateObject): + """ A Flow is a collection of objects representing a single transaction. This class is usually subclassed for each protocol, e.g. HTTPFlow. diff --git a/libmproxy/models/http.py b/libmproxy/models/http.py index dfa3a824..e07dff69 100644 --- a/libmproxy/models/http.py +++ b/libmproxy/models/http.py @@ -102,6 +102,7 @@ class MessageMixin(stateobject.StateObject): class HTTPRequest(MessageMixin, Request): + """ An HTTP request. @@ -264,6 +265,7 @@ class HTTPRequest(MessageMixin, Request): class HTTPResponse(MessageMixin, Response): + """ An HTTP response. @@ -411,6 +413,7 @@ class HTTPResponse(MessageMixin, Response): class HTTPFlow(Flow): + """ A HTTPFlow is a collection of objects representing a single HTTP transaction. @@ -544,4 +547,4 @@ def make_connect_response(http_version): "", ) -expect_continue_response = HTTPResponse(b"HTTP/1.1", 100, "Continue", Headers(), b"")
\ No newline at end of file +expect_continue_response = HTTPResponse(b"HTTP/1.1", 100, "Continue", Headers(), b"") |