aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/proxy/root_context.py
diff options
context:
space:
mode:
Diffstat (limited to 'libmproxy/proxy/root_context.py')
-rw-r--r--libmproxy/proxy/root_context.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/libmproxy/proxy/root_context.py b/libmproxy/proxy/root_context.py
index 307d0c4b..f62b0c8e 100644
--- a/libmproxy/proxy/root_context.py
+++ b/libmproxy/proxy/root_context.py
@@ -6,7 +6,6 @@ import six
from libmproxy.exceptions import ProtocolException
from netlib.exceptions import TcpException
-from netlib.http import ALPN_PROTO_H2, ALPN_PROTO_HTTP1
from ..protocol import (
RawTCPLayer, TlsLayer, Http1Layer, Http2Layer, is_tls_record_magic, ServerConnectionMixin,
UpstreamConnectLayer
@@ -85,9 +84,9 @@ class RootContext(object):
# 5. Check for TLS ALPN (HTTP1/HTTP2)
if isinstance(top_layer, TlsLayer):
alpn = top_layer.client_conn.get_alpn_proto_negotiated()
- if alpn == ALPN_PROTO_H2:
+ if alpn == b'h2':
return Http2Layer(top_layer, 'transparent')
- if alpn == ALPN_PROTO_HTTP1:
+ if alpn == b'http/1.1':
return Http1Layer(top_layer, 'transparent')
# 6. Check for raw tcp mode