Modifying Sessions before the hit the server. [FiddlerScript]

7 posts, 0 answers
  1. jacob
    jacob avatar
    5 posts
    Member since:
    Feb 2014

    Posted 15 Feb 2014 Link to this post

    The title probably isnt the best way to describe what I need.

    I tried using AutoResponder with no luck.
    So I need to write a Fiddler Script.

    There is a site making a request to a desktop application. (Through a Chrome Plugin.)
    Then data is sent to the application which then modifies settings/options (Somewhat) based on that.
    The reason AutoResponder wont work as well is because the request has data that is different each time.
    So I was thinking about using FiddlerScript to 'match' a certain part of the request that doesnt change and then 'Auto Respond' with a file, instead of the original one.

    Can anyone help me on how I would do this in FiddlerScript?

    Sorry if its hard to understand, I barely understand all this fiddler stuff with the scripts and such.

    But still, if anyone could help I would be SOOO grateful!
  2. jacob
    jacob avatar
    5 posts
    Member since:
    Feb 2014

    Posted 15 Feb 2014 in reply to jacob Link to this post

    I should also mention that I need the data being sent in the url from the first one (everything thats after: .ashx) and I need it to be appended to the new url
    So the real request or whatever would be http://host.com/Dir1/start.ashx?blah=blah&blah=blah&blah=6b7El46
    and my site that is hosting the new start.ashx is : http://MYSITE.com/myDir1/start.ashx
    But since I need the post data to be appended in the request or whatever, the new url would now be: 
    http://MYSITE.com/myDir1/start.ashx?blah=blah&blah=blah&blah=6b7El46

    Again thanks :)

    (Sorry for my bad english still learning)
  3. jacob
    jacob avatar
    5 posts
    Member since:
    Feb 2014

    Posted 15 Feb 2014 Link to this post

    I should also mention that I need the data being sent in the url from the first one (everything thats after: .ashx) and I need it to be appended to the new url
    So the real request or whatever would be http://host.com/Dir1/start.ashx?blah=blah&blah=blah&blah=6b7El46
    and my site that is hosting the new start.ashx is : http://MYSITE.com/myDir1/start.ashx
    But since I need the post data to be appended in the request or whatever, the new url would now be: 
    http://MYSITE.com/myDir1/start.ashx?blah=blah&blah=blah&blah=6b7El46

    Again thanks :)

    (Sorry for my bad english still learning)
  4. EricLaw
    EricLaw avatar
    67 posts
    Member since:
    Oct 2012

    Posted 16 Feb 2014 in reply to jacob Link to this post

    You can almost certainly do what you're asking using a Regular Expression in the AutoResponder.

    See the end of this post for details: http://blogs.msdn.com/b/fiddler/archive/2012/01/09/fiddler-2.3.8.2-beta-views-woff-mp3-h264-datauris-and-autoresponder-supports-regular-expression-groups.aspx

    (And yes, FiddlerScript can do this too)
  5. jacob
    jacob avatar
    5 posts
    Member since:
    Feb 2014

    Posted 16 Feb 2014 in reply to EricLaw Link to this post

    Thank you so much :D!

    So to be clear how do I save the end of the url and move to the second one?
    I read the post but the thing is in the first url there is also a bool value at the end and I need t change this to true, since it is false.

    I think I understand but Im just not 100%, I dont really understand Regex :/

    So sorry to bother.
  6. jacob
    jacob avatar
    5 posts
    Member since:
    Feb 2014

    Posted 16 Feb 2014 in reply to jacob Link to this post

    Man there needs to be an edit feature >_>

    Anyways I solved it with your post I wasnt thinking when I went thru it, now it makes sense!

    (Still not sure how to replace the bool at end with true :/ but other than that I think I got it!)
  7. EricLaw
    EricLaw avatar
    67 posts
    Member since:
    Oct 2012

    Posted 17 Feb 2014 in reply to jacob Link to this post

    I can help you write the regular expression you need; show me the old URL and what you want the new URL to be, as well as what regular expression you're using so far. Thanks!
Back to Top