I’m writing a client that talks to a remote server over HTTP. I would like to place an evil proxy between the client and the server that would (randomly?) affect the traffic on the wire.
Some things that I would like to happen:
- arbitrary delays for the response
- arbitrary HTTP errors
- this scenario is hard to imagine with TCP but what the hell: truncated responses (ie malformed data)
- temporary unavailability (though that seems hard given that this would have to be done at the lower network level).
- predefined custom errors (eg: every request comes back with a service error)
Basically I want to simulate a range of networking conditions that the users of this software are going to experience out in the real world and make sure the client handles them gracefully.
I suspect (hope) that something like that already exists. Please point me in the right direction!
Thanks
HTTP Test Tool (htt) seems like what you need here. It has the ability to operate as a proxy and a reverse-proxy for testing those cases specifically, when a mock framework is insufficient to the task.
For a truly evil proxy, consider using Squid in conjunction with the Metasploit Framework and some of the tools in BackTrack Linux. That seems to be a bit beyond your project scope, though!
(Additional tools to consider, plus one more)