【问题标题】:fiddler core automatic streaming can't be disable?提琴手核心自动流不能被禁用?
【发布时间】:2016-02-12 21:45:00
【问题描述】:

在不使用 ResponseHeadersAvailable 的情况下禁用来自 fiddler 核心代理的自动视频/音频流不工作。在我的场景中,我想捕获所有视频/音频请求和响应,这就是我写的这么胖:

FiddlerApplication.ResponseHeadersAvailable += FProjectStatics.OnAfterSessionComplete;

public static void OnAfterSessionComplete( Session s ){
   string sContentType = oS.oResponse.MIMEType;
   if (sContentType.OICStartsWithAny("text/event-stream", "multipart/x-mixed-replace",
   "video/", "audio/", "application/x-mms-framed"))
     {
       oS.bBufferResponse = false;
       Console.WriteLine(s.ResponseHeaders) ;
     }

}

这并没有给我任何东西,因为每个视频/音频都会显示一个 ResponseHeader .....我不能使用 ResponseAvailableHeader 因为它忽略了我感兴趣的响应正文。

有什么想法吗?

【问题讨论】:

    标签: c# http proxy fiddler fiddlercore


    【解决方案1】:

    试试这个

    FiddlerApplication.ResponseHeadersAvailable += FProjectStatics.OnAfterSessionComplete;
    FiddlerAppication.BeforeResponse += FProjectStatics.OnBeforeResponse ;
    public static void OnBeforeResponse( Session s ){
       string sContentType = oS.oResponse.MIMEType;
       if (sContentType.OICStartsWithAny("text/event-stream", "multipart/x-mixed-replace",
       "video/", "audio/", "application/x-mms-framed"))
         {
           oS.bBufferResponse = false;
         }
    
    public static void OnAfterSessionComplete( Session s ){
       string sContentType = oS.oResponse.MIMEType;
       if (sContentType.OICStartsWithAny("text/event-stream", "multipart/x-mixed-replace",
       "video/", "audio/", "application/x-mms-framed"))
         {
           Console.WriteLine(s.ResponseHeaders) ;
         }
    
    }
    

    【讨论】:

      【解决方案2】:

      使用 OnBeforeResponse 的处理程序来捕获正文。如果您也想缓冲响应,请在 ResponseHeadersAvailable 事件中仅设置 BufferResponse=true。

      为减少混淆,请不要在不相关的事件 (AfterSessionComplete) 之后命名您的事件处理方法。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多