0

I have an application that is stalling each time it makes a http request to a server. It stalls until the response is received from the server. The problem is, the server takes a while to respond to this specific http request, and takes several seconds (10-30 seconds). This causes a big lag in the application. The response to the http request is always the same (basically a "OK"), and the request never fails... it just takes a long time for the server to process it.

I am trying to remove this lag, by possibly using a proxy server or MITM application that can intercept this http request and respond immediately with the "OK", while also forwarding this http request to the server.

Are there any tools I can use this to accomplish this? I see rewrite tools available in such stuff as Charles, but these basically rewrite the http request or response, not exactly what I'm trying to do.

Basically, the flow would be this:

  1. Proxy server receives http request.
  2. Proxy server immediately responds to the http request appropriately ("OK").
  3. Proxy server sends the http request to the main server (the server the application intends to communicate with).
  4. Proxy server receives the reply (10-30 seconds) later from the main server, and simply dumps it (as the application has already received it's reply).
Adam B
  • 181
  • 1
  • 2
  • 6
  • 1
    You can't fix the application? That would probably be the easiest and cheapest option. – Michael Hampton Mar 28 '18 at 01:27
  • Yeah fixing the app will be the far more robust solution. – Nath Mar 28 '18 at 02:44
  • Fixing the app is not an option. It's an outdated app, and no source is available. We are stuck using this app for a while. – Adam B Mar 28 '18 at 05:21
  • There are no things that never fail unfortunately. What if your proposed solution responds "OK" to the client when server application doesn't but later, in 10-30 sec? This brings potential bug in your business logic. If you are not interested in server response, redirect client request to different server, that's all. – antrost Mar 28 '18 at 05:53
  • The chances of failure are so low, that I am willing to take the risk of a failed response (but the application believes it's successful.) The information needs to get sent to the server so it can be eventually saved on that server....sending it to a different server is not an option. – Adam B Mar 28 '18 at 09:08

0 Answers0