Nikita Volkov
Nikita Volkov

Reputation: 43310

Replacing http responses from a specific URL in Windows

I have some software which makes a request to a specific URL in internet and I want it to receive my custom response. Is there any software tool for that on Windows? Also it would be nice if I could map a regexp instead of specific URL

Upvotes: 1

Views: 517

Answers (4)

EricLaw
EricLaw

Reputation: 57095

Fiddler (www.fiddler2.com) has an AutoResponder feature which does exactly that.

Upvotes: 0

Nikita Volkov
Nikita Volkov

Reputation: 43310

Found the solution myself:

  1. Set the domain of the URL to point to 127.0.0.1 in windows hosts file
  2. Install nginx and set it up to show your file for the request response to which you're willing to modify and proxy all other requests to the original server

Upvotes: 1

VitalyVal
VitalyVal

Reputation: 1350

You can:

  • Try to enject your dll into the process and replace functions like (HttpSendRequest, HttpQueryInfo,...) with your oun versions.

  • Try to use something like WinPCap (http://www.winpcap.org/).

Upvotes: 0

dove
dove

Reputation: 20674

You could consider writing a test and mocking out the http response with your custom response.

I could give an example using C# and rhino mocks but it's not clear which platform you are working with.

Upvotes: 0

Related Questions