コード例 #1
0
def tserver_conn():
    c = ServerConnection._from_state(
        dict(address=dict(address=("address", 22), use_ipv6=True),
             source_address=dict(address=("address", 22), use_ipv6=True),
             cert=None))
    c.reply = controller.DummyReply()
    return c
コード例 #2
0
ファイル: tutils.py プロジェクト: Akdeniz/mitmproxy
def tserver_conn():
    c = ServerConnection._from_state(dict(
        address=dict(address=("address", 22), use_ipv6=True),
        source_address=dict(address=("address", 22), use_ipv6=True),
        cert=None
    ))
    c.reply = controller.DummyReply()
    return c
コード例 #3
0
def tserver_conn():
    """
    @return: libmproxy.proxy.connection.ServerConnection
    """
    c = ServerConnection._from_state(
        dict(address=dict(address=("address", 22), use_ipv6=True),
             state=[],
             source_address=dict(address=("address", 22), use_ipv6=True),
             cert=None))
    c.reply = controller.DummyReply()
    return c
コード例 #4
0
ファイル: tutils.py プロジェクト: acaetano/mitmproxy
def tserver_conn():
    """
    @return: libmproxy.proxy.connection.ServerConnection
    """
    c = ServerConnection._from_state(dict(
        address=dict(address=("address", 22), use_ipv6=True),
        state=[],
        source_address=dict(address=("address", 22), use_ipv6=True),
        cert=None
    ))
    c.reply = controller.DummyReply()
    return c
コード例 #5
0
ファイル: tutils.py プロジェクト: Akdeniz/mitmproxy
def tresp(req=None, content="message"):
    if not req:
        req = treq()
    f = req.flow

    headers = flow.ODictCaseless()
    headers["header_response"] = ["svalue"]
    cert = certutils.SSLCert.from_der(file(test_data.path("data/dercert"), "rb").read())
    f.server_conn = ServerConnection._from_state(dict(
        address=dict(address=("address", 22), use_ipv6=True),
        source_address=None,
        cert=cert.to_pem()))
    f.response = http.HTTPResponse((1, 1), 200, "OK", headers, content, time(), time())
    f.response.reply = controller.DummyReply()
    return f.response
コード例 #6
0
def tresp(req=None, content="message"):
    if not req:
        req = treq()
    f = req.flow

    headers = flow.ODictCaseless()
    headers["header_response"] = ["svalue"]
    cert = certutils.SSLCert.from_der(
        file(test_data.path("data/dercert"), "rb").read())
    f.server_conn = ServerConnection._from_state(
        dict(address=dict(address=("address", 22), use_ipv6=True),
             source_address=None,
             cert=cert.to_pem()))
    f.response = http.HTTPResponse((1, 1), 200, "OK", headers, content, time(),
                                   time())
    f.response.reply = controller.DummyReply()
    return f.response