mendhak / docker-http-https-echo

Docker image that echoes request data as JSON; listens on HTTP/S, useful for debugging.
https://code.mendhak.com/docker-http-https-echo/
MIT License
621 stars 136 forks source link

Force a request to sleep for a period of time #24

Closed daninthewoods closed 3 years ago

daninthewoods commented 3 years ago

This is an awesome testing utility, thanks so much. We use it a lot for testing our k8s proxy logic (nginx/haproxy etc.) If it could expand to allow a custom header to cause a sleep period for a given request, it would provide the ability to also test features of proxies like request queuing and server bottlenecking.

mendhak commented 3 years ago

I've got a tag you can test. mendhak/http-https-echo:sleep-header

Then try a curl command like this

curl -H "x-set-response-delay-ms: 9000" http://localhost:8080/
daninthewoods commented 3 years ago

Perfect, that works great. Thanks for being so responsive.

mendhak commented 3 years ago

OK nice I've tested a bit too, added to the test script.

I've merged this now it's in tag 18.

docker pull mendhak/http-https-echo:18