I am testing the timeout handling for an outbound CURL in a PHP app I am developing after an outage at an affiliate brought down my site. I am looking for a way to intentionally slowdown or permanently stall outbound connections to a specific IP address so I can tune my timeout schema. Is there any way to do this?

link|improve this question
feedback

migrated from stackoverflow.com Jul 14 '11 at 2:00

This question came from our site for professional and enthusiast programmers.

3 Answers

The Charles proxy server can do connection throttling, e.g. artificially increasing the latency or limiting the bandwidth. Install it and use the cURL CURLOPT_PROXY option to point PHP to the proxy server.

link|improve this answer
feedback

The linux traffic shaper, although normally used to enforce QoS, is also perfect to degrade connections arbitrarily.

http://lartc.org

link|improve this answer
feedback

To completely block traffic you could do an iptables drop command for the outbound traffic to that dst address.

ie

iptables -A OUTPUT --dst 129.232.64.145 -j DROP
link|improve this answer
feedback

Your Answer

 
or
required, but never shown