proxyproxyman

Is there a mechanism to delay traffic in ProxyMan?


Let's assume we have an HTTP/HTTPS traffic hitting an endpoint via GET request. The endpoint then returns a response. Is there a mechanism to delay the response for X seconds(assuming X < request timeout)? I have tried using BREAKPOINT already intuitively and was wondering if there is a direct solution for this.


Solution

  • There are two solutions:

    1. Using the Network Condition.

    Right-Click on the request you'd like to delay -> Tools -> Network Condition -> Create a rule with the 3G profile.

    Slow network with Proxyman

    1. The Network Condition will be applied to the entire domain. If you'd like to add the delay for a particular request (path + query), you might check out the sleep() func from the Scripting tool.
    function onResponse(context, url, request, response) {
      console.log("Start sleep");
      
      // Sleep 5 seconds
      sleep(5000);
      
      // Done
      return response;
    }