Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Evil proxy for testing client/server interaction

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

like image 677
EightyEight Avatar asked Mar 30 '12 22:03

EightyEight


3 Answers

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)

like image 84
MrGomez Avatar answered Nov 19 '22 11:11

MrGomez


Fiddler1 is a scriptable traffic viewer/proxy.

like image 3
MSalters Avatar answered Nov 19 '22 10:11

MSalters


You could try fiddler - everything you wrote can be simulated using that tool. It's also great for debugging communication issues between your application and the server. Saved me a lot of work when I was implementing XML-RPC.

There are some great extensions that can help you and you can even write your own if you need something really special.

[EDIT] Since this is mac question, you can try webscarab or charles (the second one is paid). But you can still run the proxy on any machine - even virtual. So if you have spare win license...

like image 3
SiliconMind Avatar answered Nov 19 '22 12:11

SiliconMind