Automatic saving of responses into autoresponder

4 posts, 1 answers
  1. Irv
    Irv avatar
    2 posts
    Member since:
    May 2015

    Posted 04 May 2015 Link to this post

    At work we use fiddler heavily to be able to record and playback URLs and their content.  However, when an environment goes down, we have to go into our list, find the URLs we care about, drag them over to the autoresponder.  I was hoping I could write (or maybe something exists) that would automatically save given URLs to the autoresponder tab when they are hit, so if the environment goes down I could just go in and enable auto responses.  Thanks for any thoughts...
  2. Answer
    Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 06 May 2015 Link to this post

    Hello, Irv--

    Fiddler can automatically save all traffic (see Tools > Configure AutoSave) to SAZ files. Fiddler's AutoResponder can load SAZ files and play them back.

    It sounds like you don't want to save and play back all traffic, only a subset of that traffic. Is there some way that you could programmatically identify traffic of interest?

    In theory, pretty much anything is possible, insofar as Fiddler extensions run all Sessions, and the AutoResponder has an object model and is fully scriptable, so if you can identify traffic programmatically, you can achieve your goal.

    Regards,
    Eric Lawrence
    Telerik
     
  3. Irv
    Irv avatar
    2 posts
    Member since:
    May 2015

    Posted 07 May 2015 Link to this post

    Thanks, I did not know about the Tools > Configure AutoSave option.  That will help a lot.

     I can definitely programmatically identify the traffic I want.  Can what you are talking about be done with FiddlerScript or do you need .NET?

     

    Thanks for the reply it is appreciated.

  4. Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 08 May 2015 Link to this post

    Hello, Irv--

    Technically, FiddlerScript can do pretty much anything you can do in a C# extension (including this task) but in practice it's usually a lot better to do advanced operations using C# because then you can use Visual Studio's debugger to step through your extension and fix problems you encounter, examine variables at breakpoints, etc.

    The primary object of interest is FiddlerApplication.oAutoResponder, which represents the Fiddler AutoResponder. You can call the various AddRule methods to create new rules; you'll probably want to use the overload:

    public ResponderRule AddRule(string sRule, Session oImportedSession, string sDescription, bool bEnabled)


    So, inside OnBeforeResponse you'd do something like:

    if (oSession.uriContains("ThingICareAbout"))
    {
       FiddlerApplication.oAutoResponder.AddRule("EXACT:"+oSession.fullUrl,
          oSession,
          "AutoGen",
          true);
    }

    Do take care that your rules list doesn't grow too huge-- Fiddler has to load the entire response for each rule every time it restarts, so a huge autoresponder rule list may slow your startup performance.


    Best of luck!
    Eric Lawrence
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top