def test_get_http1_layer_from_socks_replay(self): context = LayerContext(mode="socks", port=80) socks_layer = SocksLayer(context) layer = layer_manager._next_layer(self.server_state, socks_layer, context) self.assertIsInstance(layer, Http1Layer) context.scheme = "http" replay_layer = ReplayLayer(context) layer = layer_manager._next_layer(self.server_state, replay_layer, context) self.assertIsInstance(layer, Http1Layer) context.scheme = "https" tls_layer = TlsLayer(self.server_state, context) layer = layer_manager._next_layer(self.server_state, tls_layer, context) self.assertIsInstance(layer, Http1Layer)
def test_get_forward_layer_from_socks_replay(self): context = LayerContext(mode="socks", port=5555) socks_layer = SocksLayer(context) layer = layer_manager._next_layer(self.server_state, socks_layer, context) self.assertIsInstance(layer, ForwardLayer) context.scheme = "test" replay_layer = ReplayLayer(context) layer = layer_manager._next_layer(self.server_state, replay_layer, context) self.assertIsInstance(layer, ForwardLayer) context.scheme = "test" tls_layer = TlsLayer(self.server_state, context) layer = layer_manager._next_layer(self.server_state, tls_layer, context) self.assertIsInstance(layer, ForwardLayer)
def test_get_http1_layer_from_socks_replay(self): context = LayerContext(mode="socks", port=80) socks_layer = SocksLayer(context) layer = layer_manager._next_layer(self.server_state, socks_layer, context) self.assertIsInstance(layer, Http1Layer) context.scheme = "http" replay_layer = ReplayLayer(context) layer = layer_manager._next_layer(self.server_state, replay_layer, context) self.assertIsInstance(layer, Http1Layer) context.scheme = "https" tls_layer = TlsLayer(self.server_state, context) layer = layer_manager._next_layer(self.server_state, tls_layer, context) self.assertIsInstance(layer, Http1Layer)
def test_get_forward_layer_from_socks_replay(self): context = LayerContext(mode="socks", port=5555) socks_layer = SocksLayer(context) layer = layer_manager._next_layer(self.server_state, socks_layer, context) self.assertIsInstance(layer, ForwardLayer) context.scheme = "test" replay_layer = ReplayLayer(context) layer = layer_manager._next_layer(self.server_state, replay_layer, context) self.assertIsInstance(layer, ForwardLayer) context.scheme = "test" tls_layer = TlsLayer(self.server_state, context) layer = layer_manager._next_layer(self.server_state, tls_layer, context) self.assertIsInstance(layer, ForwardLayer)