示例#1
0
    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)
示例#2
0
    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)
示例#3
0
    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)
示例#4
0
    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)