Automated saving

8 posts, 0 answers
  1. Brice
    Brice avatar
    5 posts
    Member since:
    Aug 2014

    Posted 08 Aug 2014 Link to this post

    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
  2. Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 08 Aug 2014 Link to this post

    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.

     
  3. Brice
    Brice avatar
    5 posts
    Member since:
    Aug 2014

    Posted 11 Aug 2014 Link to this post

    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);
        }
  4. Brice
    Brice avatar
    5 posts
    Member since:
    Aug 2014

    Posted 11 Aug 2014 Link to this post

    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!
  5. Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 11 Aug 2014 Link to this post

    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.

     
  6. Brice
    Brice avatar
    5 posts
    Member since:
    Aug 2014

    Posted 11 Aug 2014 in reply to Eric Lawrence Link to this post

    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?
  7. Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 11 Aug 2014 Link to this post

    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.

     
  8. Brice
    Brice avatar
    5 posts
    Member since:
    Aug 2014

    Posted 13 Aug 2014 in reply to Eric Lawrence Link to this post

    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!
Back to Top