コード例 #1
0
ファイル: tutils.py プロジェクト: ch0psticks/mitmproxy
def tclient_conn():
    c = ClientConnection._from_state(dict(
        address=dict(address=("address", 22), use_ipv6=True),
        clientcert=None
    ))
    c.reply = controller.DummyReply()
    return c
コード例 #2
0
def tclient_conn():
    """
    @return: libmproxy.proxy.connection.ClientConnection
    """
    c = ClientConnection.from_state(
        dict(address=dict(address=("address", 22), use_ipv6=True),
             clientcert=None))
    c.reply = controller.DummyReply()
    return c
コード例 #3
0
ファイル: tutils.py プロジェクト: 0xr0ot/mitmproxy
def tclient_conn():
    """
    @return: libmproxy.proxy.connection.ClientConnection
    """
    c = ClientConnection.from_state(dict(
        address=dict(address=("address", 22), use_ipv6=True),
        clientcert=None
    ))
    c.reply = controller.DummyReply()
    return c
コード例 #4
0
ファイル: test_flow.py プロジェクト: aykutakar/mitmproxy
    def test_state(self):

        c = tutils.tclient_conn()
        assert ClientConnection._from_state(c._get_state()) == c

        c2 = tutils.tclient_conn()
        c2.address.address = (c2.address.host, 4242)
        assert not c == c2

        c2.timestamp_start = 42
        c._load_state(c2._get_state())
        assert c.timestamp_start == 42

        c3 = c.copy()
        assert c3 == c

        assert str(c)
コード例 #5
0
    def test_state(self):

        c = tutils.tclient_conn()
        assert ClientConnection._from_state(c._get_state()) == c

        c2 = tutils.tclient_conn()
        c2.address.address = (c2.address.host, 4242)
        assert not c == c2

        c2.timestamp_start = 42
        c._load_state(c2._get_state())
        assert c.timestamp_start == 42

        c3 = c.copy()
        assert c3 == c

        assert str(c)
コード例 #6
0
ファイル: tutils.py プロジェクト: yuljasc/mitmproxy
def tclient_conn():
    c = ClientConnection._from_state(
        dict(address=dict(address=("address", 22), use_ipv6=True),
             clientcert=None))
    c.reply = controller.DummyReply()
    return c