diff --git a/mitmproxy/proxy/protocol/http.py b/mitmproxy/proxy/protocol/http.py index 9fe83ff61..3bc33ab0e 100644 --- a/mitmproxy/proxy/protocol/http.py +++ b/mitmproxy/proxy/protocol/http.py @@ -138,7 +138,7 @@ class HttpLayer(base.Layer): def __init__(self, ctx, mode): super().__init__(ctx) if mode not in MODES: - raise exceptions.ServerException("Invalid mode: %s"%mode) + raise exceptions.ServerException("Invalid mode: %s" % mode) self.mode = mode self.__initial_server_conn = None "Contains the original destination in transparent mode, which needs to be restored" diff --git a/mitmproxy/proxy/root_context.py b/mitmproxy/proxy/root_context.py index eacf7e0b8..4362347bc 100644 --- a/mitmproxy/proxy/root_context.py +++ b/mitmproxy/proxy/root_context.py @@ -90,16 +90,7 @@ class RootContext: if alpn == b'http/1.1': return protocol.Http1Layer(top_layer, 'transparent') - # 6. Check for raw tcp mode - is_ascii = ( - len(d) == 3 and - # expect A-Za-z - all(65 <= x <= 90 or 97 <= x <= 122 for x in d) - ) - if self.config.options.rawtcp and not is_ascii: - return protocol.RawTCPLayer(top_layer) - - # 7. Assume HTTP1 by default + # 6. Assume HTTP1 by default return protocol.Http1Layer(top_layer, 'transparent') def log(self, msg, level, subs=()):