コード例 #1
0
ファイル: proxyserver.py プロジェクト: Pactortester/mitmproxy
 async def handle_hook(self, hook: commands.StartHook) -> None:
     with self.timeout_watchdog.disarm():
         # We currently only support single-argument hooks.
         data, = hook.args()
         await self.master.addons.handle_lifecycle(hook)
         if isinstance(data, flow.Flow):
             await data.wait_for_resume()
コード例 #2
0
 async def handle_hook(self, hook: commands.StartHook) -> None:
     with self.timeout_watchdog.disarm():
         # We currently only support single-argument hooks.
         data, = hook.args()
         data.reply = AsyncReply(data)
         await self.master.addons.handle_lifecycle(hook)
         await data.reply.done.wait()
         data.reply = None
コード例 #3
0
 async def handle_hook(self, hook: commands.StartHook) -> None:
     data, = hook.args()
     data.reply = AsyncReply(data)
     await ctx.master.addons.handle_lifecycle(hook)
     await data.reply.done.wait()
     if isinstance(hook, (layers.http.HttpResponseHook, layers.http.HttpErrorHook)):
         if self.transports:
             # close server connections
             for x in self.transports.values():
                 if x.handler:
                     x.handler.cancel()
             await asyncio.wait([x.handler for x in self.transports.values() if x.handler])
         # signal completion
         self.done.set()
コード例 #4
0
ファイル: server.py プロジェクト: vevenlcf/mitmproxy-1
 async def handle_hook(
         self,
         hook: commands.StartHook
 ) -> None:
     if hook.name in self.hook_handlers:
         self.hook_handlers[hook.name](*hook.args())