示例#1
0
文件: start.py 项目: Terrycy/MAD
        logger.info('Starting websocket server on port {}'.format(
            str(args.ws_port)))
        ws_server = WebsocketServer(args,
                                    mitm_mapper,
                                    db_wrapper,
                                    mapping_manager,
                                    pogoWindowManager,
                                    data_manager,
                                    event=event)
        t_ws = Thread(name='scanner', target=ws_server.start_server)
        t_ws.daemon = False
        t_ws.start()

        # init jobprocessor
        device_Updater = deviceUpdater(ws_server, args, jobstatus, db_wrapper)

        webhook_worker = None
        if args.webhook:
            from mapadroid.webhook.webhookworker import WebhookWorker

            rarity = Rarity(args, db_wrapper)
            rarity.start_dynamic_rarity()

            webhook_worker = WebhookWorker(args, data_manager, mapping_manager,
                                           rarity, db_wrapper.webhook_reader)
            t_whw = Thread(name="webhook_worker",
                           target=webhook_worker.run_worker)
            t_whw.daemon = True
            t_whw.start()
示例#2
0
文件: start.py 项目: nepixl/MAD
                                      enable_configmode=args.config_mode)
 mitm_receiver_process.start()
 logger.info('Starting websocket server on port {}'.format(str(
     args.ws_port)))
 ws_server = WebsocketServer(args=args,
                             mitm_mapper=mitm_mapper,
                             db_wrapper=db_wrapper,
                             mapping_manager=mapping_manager,
                             pogo_window_manager=pogoWindowManager,
                             data_manager=data_manager,
                             event=event,
                             enable_configmode=args.config_mode)
 t_ws = Thread(name='scanner', target=ws_server.start_server)
 t_ws.daemon = False
 t_ws.start()
 device_Updater = deviceUpdater(ws_server, args, jobstatus, db_wrapper,
                                storage_elem)
 if not args.config_mode:
     if args.webhook:
         rarity = Rarity(args, db_wrapper)
         rarity.start_dynamic_rarity()
         webhook_worker = WebhookWorker(args, data_manager, mapping_manager,
                                        rarity, db_wrapper.webhook_reader)
         t_whw = Thread(name="webhook_worker",
                        target=webhook_worker.run_worker)
         t_whw.daemon = True
         t_whw.start()
     if args.statistic:
         logger.info("Starting statistics collector")
         t_usage = Thread(name='system',
                          target=get_system_infos,
                          args=(db_wrapper, ))