def process_options(parser, options): if options.sysinfo: print(debug.sysinfo()) sys.exit(0) if options.quiet: options.verbose = 0 debug.register_info_dumpers() return config.process_proxy_options(parser, options)
def process_options(parser, options, args): if args.sysinfo: print(debug.sysinfo()) sys.exit(0) if args.quiet: args.verbose = 0 debug.register_info_dumpers() return config.ProxyConfig(options)
def process_options(parser, options, args): if args.sysinfo: print(debug.sysinfo()) sys.exit(0) debug.register_info_dumpers() pconf = config.ProxyConfig(options) if options.no_server: return server.DummyServer(pconf) else: try: return server.ProxyServer(pconf) except exceptions.ServerException as v: print(str(v), file=sys.stderr) sys.exit(1)
def process_options(parser, options, args): from mitmproxy.proxy import server if args.sysinfo: print(debug.sysinfo()) try: debug.register_info_dumpers() except Exception as e: print(str(e)) pconf = config.ProxyConfig(options) if options.no_server: return server.DummyServer(pconf) else: try: return server.ProxyServer(pconf) except exceptions.ServerException as v: print(str(v)) return
def test_sysinfo(): assert debug.sysinfo()