This is a migrated thread and some comments may be shown as answers.

Automatic saving of responses into autoresponder

3 Answers 564 Views
Extensions and Customization
This is a migrated thread and some comments may be shown as answers.
Irv
Top achievements
Rank 1
Irv asked on 04 May 2015, 07:48 PM
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...

3 Answers, 1 is accepted

Sort by
0
Accepted
Eric Lawrence
Telerik team
answered on 07 May 2015, 12:42 AM
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
 
0
Irv
Top achievements
Rank 1
answered on 07 May 2015, 01:05 PM

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.

0
Eric Lawrence
Telerik team
answered on 08 May 2015, 03:51 PM
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.

 
Tags
Extensions and Customization
Asked by
Irv
Top achievements
Rank 1
Answers by
Eric Lawrence
Telerik team
Irv
Top achievements
Rank 1
Share this question
or