コード例 #1
0
ファイル: test_manager.py プロジェクト: mike820324/microProxy
    def test_get_http2_layer(self):
        context = LayerContext(mode="socks", port=443, scheme="h2")

        replay_layer = ReplayLayer(context)
        layer = layer_manager._next_layer(self.server_state, replay_layer, context)
        self.assertIsInstance(layer, Http2Layer)

        tls_layer = TlsLayer(self.server_state, context)
        layer = layer_manager._next_layer(self.server_state, tls_layer, context)
        self.assertIsInstance(layer, Http2Layer)
コード例 #2
0
ファイル: test_manager.py プロジェクト: tawawhite/microProxy
    def test_get_http2_layer(self):
        context = LayerContext(mode="socks", port=443, scheme="h2")

        replay_layer = ReplayLayer(context)
        layer = layer_manager._next_layer(self.server_state, replay_layer,
                                          context)
        self.assertIsInstance(layer, Http2Layer)

        tls_layer = TlsLayer(self.server_state, context)
        layer = layer_manager._next_layer(self.server_state, tls_layer,
                                          context)
        self.assertIsInstance(layer, Http2Layer)
コード例 #3
0
ファイル: test_manager.py プロジェクト: tawawhite/microProxy
    def test_get_tls_layer_from_socks(self):
        context = LayerContext(mode="socks", port=443)

        socks_layer = SocksLayer(context)
        layer = layer_manager._next_layer(self.server_state, socks_layer,
                                          context)
        self.assertIsInstance(layer, TlsLayer)
コード例 #4
0
ファイル: test_manager.py プロジェクト: tawawhite/microProxy
    def test_get_http_layer_from_http_layer(self):
        context = LayerContext(mode="http", scheme="http", port=80)

        http_layer = Http1Layer(self.server_state, context)
        layer = layer_manager._next_layer(self.server_state, http_layer,
                                          context)
        self.assertIsInstance(layer, Http1Layer)
コード例 #5
0
ファイル: test_manager.py プロジェクト: mike820324/microProxy
    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)
コード例 #6
0
ファイル: test_manager.py プロジェクト: mike820324/microProxy
    def test_get_http_layer_from_http_layer(self):
        context = LayerContext(mode="http", scheme="http", port=80)

        http_layer = Http1Layer(self.server_state, context)
        layer = layer_manager._next_layer(
            self.server_state, http_layer, context)
        self.assertIsInstance(layer, Http1Layer)
コード例 #7
0
ファイル: test_manager.py プロジェクト: mike820324/microProxy
    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)
コード例 #8
0
ファイル: test_manager.py プロジェクト: tawawhite/microProxy
    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)
コード例 #9
0
ファイル: test_manager.py プロジェクト: tawawhite/microProxy
    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)
コード例 #10
0
ファイル: test_manager.py プロジェクト: tawawhite/microProxy
 def test_get_http1_layer_from_transparent(self):
     context = LayerContext(mode="socks", port=80)
     transparent_layer = TransparentLayer(context)
     layer = layer_manager._next_layer(self.server_state, transparent_layer,
                                       context)
     self.assertIsInstance(layer, Http1Layer)
コード例 #11
0
ファイル: test_manager.py プロジェクト: mike820324/microProxy
 def test_get_http1_layer_from_transparent(self):
     context = LayerContext(mode="socks", port=80)
     transparent_layer = TransparentLayer(context)
     layer = layer_manager._next_layer(self.server_state, transparent_layer, context)
     self.assertIsInstance(layer, Http1Layer)
コード例 #12
0
ファイル: test_manager.py プロジェクト: mike820324/microProxy
    def test_get_tls_layer_from_socks(self):
        context = LayerContext(mode="socks", port=443)

        socks_layer = SocksLayer(context)
        layer = layer_manager._next_layer(self.server_state, socks_layer, context)
        self.assertIsInstance(layer, TlsLayer)