Search code examples
fiddler

Fiddler - add latency on single response without modifying response


In Fiddler how can I slow down the response of a specific request only, while passing through the response from the server?

I'm aware I can simulate a slow speed for all requests - that's not what I want.

Using the AutoResponder with a specific rule forces me to choose what to respond with.

enter image description here

How can I use the "Latency" feature without modifying the response? Is this possible in Fiddler?


Solution

  • I understood your question that you want to delay either request or response time for a specific request.

    You could do it with the FiddlerScript module by updating the oSession object.

    onBeforeRequest

    // Delay sends by 300ms per KB uploaded.
    oSession["request-trickle-delay"] = "300"; 
    

    onBeforeResponse

    // Delay receives by 150ms per KB downloaded.
    oSession["response-trickle-delay"] = "150"; 
    

    You would also need to filter the correct request in the selected method.

    Filtering

    // Sample Rule: Break requests for URLs containing "/path/"
    if (oSession.uriContains("/path/")) {
    }
    
    if (oSession.hostname == "some.hostname") {
    }
    
    if (oSession.url == "some.url") {
    }
    

    Additional info can be found here

    Hope it helps