当前位置: 首页>>代码示例>>Python>>正文


Python proxy.ProxyServer方法代码示例

本文整理汇总了Python中mitmproxy.proxy.ProxyServer方法的典型用法代码示例。如果您正苦于以下问题:Python proxy.ProxyServer方法的具体用法?Python proxy.ProxyServer怎么用?Python proxy.ProxyServer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mitmproxy.proxy的用法示例。


在下文中一共展示了proxy.ProxyServer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from mitmproxy import proxy [as 别名]
# 或者: from mitmproxy.proxy import ProxyServer [as 别名]
def __init__(self, port=12345, mode="regular", cadir="ssl/"):
        super(ProxyDaemon, self).__init__()

        if not os.path.exists(cadir):
            logger.error("%s does not exist" % cadir)
            raise ValueError("%s does not exist" % cadir)

        global HINT
        while True:
            try:
                opts = options.Options(
                    listen_port=port + HINT,
                    mode=mode,
                    cadir=cadir
                )

                config = ProxyConfig(opts)
                server = ProxyServer(config)
                self.port = port+HINT
                self.mproxy = Proxy(opts, server)
                break
            except ServerException:
                pass
            finally:
                HINT += 1 
开发者ID:CvvT,项目名称:crawler_sqlmap,代码行数:27,代码来源:proxy.py

示例2: MainProxy

# 需要导入模块: from mitmproxy import proxy [as 别名]
# 或者: from mitmproxy.proxy import ProxyServer [as 别名]
def MainProxy():
    """
    The Proxy called by waunitproxy
    """
    # Configuration file
    if(os.path.isfile(args.config_file)):
    #use ~/.mitmproxy/mitmproxy-ca.pem as default CA file.
        proxyconfig = ProxyConfig(port = config.getint('Proxy', 'port'),
        cadir = "~/.mitmproxy/")
        state = flow.State()
        server = ProxyServer(proxyconfig)
        try:
            m = GoogleAnalyticsUniversal(server, state)
            m.run()
        except (KeyboardInterrupt):
            pass
    else:
        print "Invalid config file. Use --config to specify the configuration file (e.g. --config waunit.cfg)" 
开发者ID:joaolcorreia,项目名称:WAUnit,代码行数:20,代码来源:main.py

示例3: start_master

# 需要导入模块: from mitmproxy import proxy [as 别名]
# 或者: from mitmproxy.proxy import ProxyServer [as 别名]
def start_master(self, dump_file_path, op_mode):
        logger.info('Starting master')
        config = proxy.ProxyConfig(
            port = self.port,
            mode = op_mode
        )

        dump_options = dump.Options(
            verbosity = 3,
            eventlog = True,
            flow_detail = True,
            showhost = True,
            outfile = (dump_file_path, 'wb')
        )

        server = proxy.ProxyServer(config)
        proxy_master = ProxyMaster(server, dump_options)
        proxy_master.run() 
开发者ID:ucsb-seclab,项目名称:agrigento,代码行数:20,代码来源:proxy_server.py

示例4: main

# 需要导入模块: from mitmproxy import proxy [as 别名]
# 或者: from mitmproxy.proxy import ProxyServer [as 别名]
def main():
    opts, args = getopt.getopt(sys.argv[1:], "hp:w:")
    strPort=8888
    fnamescript='__crisschan_TEMP'+str(time.time())
    for op, value in opts:
        if op == "-p":
            strPort = value
        elif op == "-w":
            fnamescript = value
        elif op == "-h":
            #usage()
            print '-p the proxy port\r\n-w the script_solution  name'
            sys.exit()

    config = proxy.ProxyConfig(
        cadir=os.path.expanduser("~/.mitmproxy/"),
        port=int(strPort)
    )
    server = proxy.ProxyServer(config)
    print 'the porxy port is '+str(strPort)
    m = FriedRing(server, fnamescript)
    m.run() 
开发者ID:crisschan,项目名称:FriedRing,代码行数:24,代码来源:fr.py

示例5: start_server

# 需要导入模块: from mitmproxy import proxy [as 别名]
# 或者: from mitmproxy.proxy import ProxyServer [as 别名]
def start_server(port, mode, domain):
    if mode == "http":
        mode = "regular"
    opts = options.Options(
        cadir="~/.mitmproxy/",
        listen_port=int(port) or 8080,
        mode=mode
    )
    if domain:
        global _domain
        _domain = domain
    config = ProxyConfig(opts)
    server = ProxyServer(config)
    m = MyMaster(opts, server)
    m.run() 
开发者ID:jjf012,项目名称:PassiveScanner,代码行数:17,代码来源:proxy.py


注:本文中的mitmproxy.proxy.ProxyServer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。