diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-08-01 12:43:20 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-08-01 14:37:33 +0200 |
commit | 54866c0faa73f9c2dd34712ddc0a5f7e4d16f0db (patch) | |
tree | a27d60c7bb4f285b6e133363b85dc1ca07b04d58 /libmproxy | |
parent | db02553e2afee044faac898d12bd8d1adadbcd21 (diff) | |
download | mitmproxy-54866c0faa73f9c2dd34712ddc0a5f7e4d16f0db.tar.gz mitmproxy-54866c0faa73f9c2dd34712ddc0a5f7e4d16f0db.tar.bz2 mitmproxy-54866c0faa73f9c2dd34712ddc0a5f7e4d16f0db.zip |
revert hard-coded HTTP/2 protocol changes
Diffstat (limited to 'libmproxy')
-rw-r--r-- | libmproxy/protocol/http.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py index 961e50a6..b54d4a11 100644 --- a/libmproxy/protocol/http.py +++ b/libmproxy/protocol/http.py @@ -167,8 +167,10 @@ class HTTPHandler(ProtocolHandler): try: if not self.c.server_conn.protocol: # instantiate new protocol if connection does not have one yet - self.c.server_conn.protocol = http2.HTTP2Protocol(self.c.server_conn) # TODO: select correct protocol - self.c.server_conn.protocol.perform_connection_preface() + # TODO: select correct protocol based on ALPN (?) + self.c.server_conn.protocol = http1.HTTP1Protocol(self.c.server_conn) + # self.c.server_conn.protocol = http2.HTTP2Protocol(self.c.server_conn) + # self.c.server_conn.protocol.perform_connection_preface() self.c.server_conn.send(self.c.server_conn.protocol.assemble(flow.request)) @@ -249,13 +251,12 @@ class HTTPHandler(ProtocolHandler): ret = self.process_request(flow, req) if ret: # instantiate new protocol if connection does not have one yet - # TODO: select correct protocol - flow.client_conn.protocol = http2.HTTP2Protocol(self.c.client_conn, is_server=True) + # TODO: select correct protocol based on ALPN (?) + flow.client_conn.protocol = http1.HTTP1Protocol(self.c.client_conn) + # flow.client_conn.protocol = http2.HTTP2Protocol(self.c.client_conn, is_server=True) if ret is not None: return ret - print("still here: %s" % flow.client_conn.protocol.__class__) - # Be careful NOT to assign the request to the flow before # process_request completes. This is because the call can raise an # exception. If the request object is already attached, this results @@ -745,7 +746,7 @@ class RequestReplayThread(threading.Thread): server.send(self.flow.server_conn.protocol.assemble(r)) self.flow.server_conn = server - + self.flow.server_conn.protocol = http1.HTTP1Protocol(self.flow.server_conn) self.flow.response = HTTPResponse.from_protocol( self.flow.server_conn.protocol, r.method, |