0

I have a data provider server that response with some faulty json string to refresh token (HTTP). This cause my software to disconnect from the web-socket (different url). The desired behavior is to retry refreshing and if fails than to reconnect from scratch to the providers web-socket using a new login message to authorization http server endpoint.

Is it possible to intentionally redirect a specific URL/URI to an internal server on my local server and emulate as if the faulty message was sent from the providers authorization http server endpoint? (it takes two days to reproduce this bug on my providers authorization) I wish to rapidly get this error so I could build exception handling on my server and code a retry code to recover from this bug (I can not access the providers server so I cant fix their bug) . Thanks Ori

what I tried: I addressed this question to the support portal of my data provider but it is not fixed until now. I must build some resilient code to recover from the crash that happens when this bug influence my code/system.

  • Fiddler can do this with "responders", I think they're called. – CodeCaster Nov 03 '22 at 09:35
  • Thanks CodeCaster. will look in to it.... – Ori Kovacsi-Katz Nov 03 '22 at 09:40
  • @CodeCaster can you share with me a link to git python example to mock a response from a specific url/uri using Fiddler ? as far as I searched fiddler is some Machine Learning system not a mock server for python? – Ori Kovacsi-Katz Nov 03 '22 at 10:20
  • Fiddler is an HTTP proxy for Windows, which you must download and install (I'd recommend the Classic version). Once started, it intercepts all requests your machine makes. You can configure an auto-responder to give a fixed response for requests to a given URL, for example. – CodeCaster Nov 03 '22 at 10:31
  • The question does not state it is integrated on Windows. it can be Linux/Ubuntu/Mac or any other. – Ori Kovacsi-Katz Nov 04 '22 at 17:06

0 Answers0