diff options
| author | Thomas Kriechbaumer <Kriechi@users.noreply.github.com> | 2017-02-24 15:42:52 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-24 15:42:52 +0100 |
| commit | 83f1e2eec01ab3edec723b252b0c109f00b77c56 (patch) | |
| tree | 9222f639c50e252339378e8c881474274adc8ae4 /pathod | |
| parent | d0d11cec7b479932668eb4e7c99d7824018d0460 (diff) | |
| parent | fab3a8dcf4d7cdce55099172e45a6a0978eac4ab (diff) | |
| download | mitmproxy-83f1e2eec01ab3edec723b252b0c109f00b77c56.tar.gz mitmproxy-83f1e2eec01ab3edec723b252b0c109f00b77c56.tar.bz2 mitmproxy-83f1e2eec01ab3edec723b252b0c109f00b77c56.zip | |
Merge pull request #2050 from Kriechi/create_connection
nuke tcp.Address and add proper IPv6 support
Diffstat (limited to 'pathod')
| -rw-r--r-- | pathod/pathoc.py | 4 | ||||
| -rw-r--r-- | pathod/pathod.py | 2 | ||||
| -rw-r--r-- | pathod/protocols/http2.py | 6 | ||||
| -rw-r--r-- | pathod/test.py | 6 |
4 files changed, 9 insertions, 9 deletions
diff --git a/pathod/pathoc.py b/pathod/pathoc.py index 549444ca..4a613349 100644 --- a/pathod/pathoc.py +++ b/pathod/pathoc.py @@ -239,7 +239,7 @@ class Pathoc(tcp.TCPClient): is_client=True, staticdir=os.getcwd(), unconstrained_file_access=True, - request_host=self.address.host, + request_host=self.address[0], protocol=self.protocol, ) @@ -286,7 +286,7 @@ class Pathoc(tcp.TCPClient): socks.VERSION.SOCKS5, socks.CMD.CONNECT, socks.ATYP.DOMAINNAME, - tcp.Address.wrap(connect_to) + connect_to, ) connect_request.to_file(self.wfile) self.wfile.flush() diff --git a/pathod/pathod.py b/pathod/pathod.py index 8d57897b..7416d325 100644 --- a/pathod/pathod.py +++ b/pathod/pathod.py @@ -166,7 +166,7 @@ class PathodHandler(tcp.BaseHandler): headers=headers.fields, http_version=http_version, sni=self.sni, - remote_address=self.address(), + remote_address=self.address, clientcert=clientcert, first_line_format=first_line_format ), diff --git a/pathod/protocols/http2.py b/pathod/protocols/http2.py index 628e3f33..7c88c5c7 100644 --- a/pathod/protocols/http2.py +++ b/pathod/protocols/http2.py @@ -172,9 +172,9 @@ class HTTP2StateProtocol: def assemble_request(self, request): assert isinstance(request, mitmproxy.net.http.request.Request) - authority = self.tcp_handler.sni if self.tcp_handler.sni else self.tcp_handler.address.host - if self.tcp_handler.address.port != 443: - authority += ":%d" % self.tcp_handler.address.port + authority = self.tcp_handler.sni if self.tcp_handler.sni else self.tcp_handler.address[0] + if self.tcp_handler.address[1] != 443: + authority += ":%d" % self.tcp_handler.address[1] headers = request.headers.copy() diff --git a/pathod/test.py b/pathod/test.py index b819d723..81f5805f 100644 --- a/pathod/test.py +++ b/pathod/test.py @@ -97,8 +97,8 @@ class _PaThread(basethread.BaseThread): **self.daemonargs ) self.name = "PathodThread (%s:%s)" % ( - self.server.address.host, - self.server.address.port + self.server.address[0], + self.server.address[1], ) - self.q.put(self.server.address.port) + self.q.put(self.server.address[1]) self.server.serve_forever() |
