aboutsummaryrefslogtreecommitdiffstats
path: root/pathod/protocols/http2.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-02-18 23:10:47 +0100
committerMaximilian Hils <git@maximilianhils.com>2016-02-18 23:10:47 +0100
commit7c6bf7abb3c0e94f9c4dfa77fe0690fe11c6d4d3 (patch)
tree3f583d91ff97924068f7017f770b710da2768abe /pathod/protocols/http2.py
parentbe02dd105b7803b7b2b6942f9d254539dfd6ba26 (diff)
parent61cde30ef8410dc5400039eea5d312fabf3779a9 (diff)
downloadmitmproxy-7c6bf7abb3c0e94f9c4dfa77fe0690fe11c6d4d3.tar.gz
mitmproxy-7c6bf7abb3c0e94f9c4dfa77fe0690fe11c6d4d3.tar.bz2
mitmproxy-7c6bf7abb3c0e94f9c4dfa77fe0690fe11c6d4d3.zip
Merge pull request #964 from mitmproxy/flat-structure
Flat structure
Diffstat (limited to 'pathod/protocols/http2.py')
-rw-r--r--pathod/protocols/http2.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/pathod/protocols/http2.py b/pathod/protocols/http2.py
new file mode 100644
index 00000000..a098a14e
--- /dev/null
+++ b/pathod/protocols/http2.py
@@ -0,0 +1,20 @@
+from netlib.http import http2
+from .. import version, app, language, utils, log
+
+class HTTP2Protocol:
+
+ def __init__(self, pathod_handler):
+ self.pathod_handler = pathod_handler
+ self.wire_protocol = http2.HTTP2Protocol(
+ self.pathod_handler, is_server=True, dump_frames=self.pathod_handler.http2_framedump
+ )
+
+ def make_error_response(self, reason, body):
+ return language.http2.make_error_response(reason, body)
+
+ def read_request(self, lg=None):
+ self.wire_protocol.perform_server_connection_preface()
+ return self.wire_protocol.read_request(self.pathod_handler.rfile)
+
+ def assemble(self, message):
+ return self.wire_protocol.assemble(message)