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

Automated saving

7 Answers 194 Views
Fiddler Classic
This is a migrated thread and some comments may be shown as answers.
Brice
Top achievements
Rank 1
Brice asked on 08 Aug 2014, 07:58 PM
Happy Friday!

I'm trying to use fiddler in the most automated way possible. I've set it up as a service, that works fine, I can see it running...etc. And I'm trying to get it to dump any data that it's collected to a _stored archive file. That also works. What ISNT working is one of two things, either the service has started (program running in the background) and it's not collecting against the user account i'm currently logged onto, or the program itself is not being shut down correctly to trigger the dump. at this moment, to stop the program I either need to kill the process in the task manager or stop the service.

Again, if I manually open fiddler and view the web, and close the program, it'll dump the info no problem. Does anyone have any ideas? this is to troubleshoot an issue some of my users are having that do not have the time to manually open fiddler when they start work, close it when the website crashes, and grab the dump for us to start sorting through.

any help is greatly appreciated!

Brice Jones

7 Answers, 1 is accepted

Sort by
0
Eric Lawrence
Telerik team
answered on 08 Aug 2014, 09:32 PM
Hi, Brice--

Fiddler itself isn't really designed for service use; most folks that want to do Fiddler-like things will build an application atop FiddlerCore. For end-user bug reporting, http://fiddlercap.com is typically a good choice.

When you start Fiddler as a service, it changes the proxy settings only for that (service) user-account, not for the user account of a foreground user. You'd need to manually configure the foreground user's proxy settings to point at 127.0.0.1:8888 (or set the ProxySettingsPerUser=0 group policy and run Fiddler as Admin) to get traffic from foreground user accounts.

You haven't mentioned how you're triggering a save of the traffic? One approach would be to save the traffic anytime you see a request for a given "magic URL" (e.g. http://localhost.fiddler:8888/savetrafficnow) and you'd just manually "invoke" a save operation that way...

Regards,
Eric Lawrence
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Brice
Top achievements
Rank 1
answered on 11 Aug 2014, 12:41 PM
How i'm currently triggering the dump is in the custom rules on the "onshutdown" function. I found some code that forces it to dump the info.

static function OnShutdown() {
        // MessageBox.Show("Fiddler has shutdown");
  FiddlerApplication.UI.actSelectAll();
    var sFilename = (CONFIG.GetPath("Captures") + "_stored.saz");
    FiddlerApplication.UI.actSaveSessionsToZip(sFilename);
    }
0
Brice
Top achievements
Rank 1
answered on 11 Aug 2014, 12:58 PM
also, i'm a complete novice at this software and how to make it do what I need to do, any in-depth instruction would be appreciated. Thanks again for all the help!
0
Eric Lawrence
Telerik team
answered on 11 Aug 2014, 01:52 PM
Hello, Brice--

Using OnShutdown will work fine if the application is properly closed (e.g. Exited) rather than being killed (terminated by the OS).

Regards,
Eric Lawrence
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Brice
Top achievements
Rank 1
answered on 11 Aug 2014, 01:54 PM
which must be the problem, since it's running as a service, if you kill the service you aren't properly closing the software so the "onshutdown" isn't being triggered. Can you think of any way around that? I've set up the service per this website http://fiddler.wikidot.com/runasservice and that part appears to be working. I've also manually configured the proxy to point to the local host at the 8888 port so I think the last part is the triggering process. Any ideas around it or a better way to do it?
0
Eric Lawrence
Telerik team
answered on 11 Aug 2014, 09:30 PM
Hello, Brice--

Don't kill the service?

Another approach is to write code inside the OnBeforeRequest handler that looks for a "magic URL" and writes out the SAZ if it ever sees it.

   if (oSession.uriContains("SaveSAZNOW")) {
     FiddlerApplication.UI.actSelectAll();
       var sFilename =  "C:\\writeabletempfolder\\_stored.saz";
        FiddlerApplication.UI.actSaveSessionsToZip(sFilename);
   }


Regards,
Eric Lawrence
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Brice
Top achievements
Rank 1
answered on 13 Aug 2014, 12:56 PM
Good Afternoon, I finally got it to work how I wanted to. Basically just scrapped what I initially wanted to do and went a different route. Same result (of what I wanted), just different way to do it. You can close/delete this thread. Thanks for all the help!
Tags
Fiddler Classic
Asked by
Brice
Top achievements
Rank 1
Answers by
Eric Lawrence
Telerik team
Brice
Top achievements
Rank 1
Share this question
or