{"id":16827228,"url":"https://github.com/deminy/docker-delayed-http-response","last_synced_at":"2025-08-31T14:36:09.466Z","repository":{"id":151093140,"uuid":"622030563","full_name":"deminy/docker-delayed-http-response","owner":"deminy","description":"Dockerized web server to simulate delays in HTTP requests.","archived":false,"fork":false,"pushed_at":"2023-04-01T06:31:11.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-24T08:30:35.611Z","etag":null,"topics":["docker","http","nginx"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/deminy/delayed-http-response","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deminy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-31T23:46:56.000Z","updated_at":"2023-04-03T19:14:29.000Z","dependencies_parsed_at":"2023-04-09T05:33:49.256Z","dependency_job_id":null,"html_url":"https://github.com/deminy/docker-delayed-http-response","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deminy%2Fdocker-delayed-http-response","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deminy%2Fdocker-delayed-http-response/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deminy%2Fdocker-delayed-http-response/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deminy%2Fdocker-delayed-http-response/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deminy","download_url":"https://codeload.github.com/deminy/docker-delayed-http-response/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244123242,"owners_count":20401559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","http","nginx"],"created_at":"2024-10-13T11:20:04.388Z","updated_at":"2025-03-17T22:52:54.572Z","avatar_url":"https://github.com/deminy.png","language":"Dockerfile","readme":"## Dockerized web server to simulate delays in HTTP requests.\n[![License](https://img.shields.io/github/license/deminy/docker-delayed-http-response)](https://github.com/deminy/docker-delayed-http-response)\n\nThis Docker image is to simulate delays in HTTP requests. It is to help developers to test how their application behaves to a slow response from an upstream service.\n\n## Table of Contents\n\n* [Endpoints](#endpoints)\n* [How To Use It](#how-to-use-it)\n    * [Endpoint /sleep/:period](#endpoint-sleepperiod)\n    * [Endpoint /delay/:period/:url](#endpoint-delayperiodurl)\n* [Alternatives](#alternatives)\n\n## Endpoints\n\nThere are two endpoints privided:\n\n1. `/sleep/:period` - The request will be delayed for the specified period of time, in seconds.\n2. `/delay/:period/:url` - The request will be delayed for the specified period of time, in seconds, and then forwarded to the specified URL.\n\nThe period might takes three digits after the decimal point and must be greater than 0.001.\n\nThe web server is built using Nginx, with third-party module [ngx_echo][1] (the HTTP Echo module) and [ngx_http_lua][2] in use. The server handles concurrent requests without blocking.\n\n## How To Use It\n\nBefore making any requests, you need to start the Docker container first:\n\n```bash\ndocker run --rm -d -p 80:80 -ti deminy/delayed-http-response\n```\n\nThe above command will start the container in the background, and expose the port 80 to the host machine.\n\n### Endpoint `/sleep/:period`\n\nThis endpoint always returns a 200 OK response, with string \"OK\" as the body. Here are some examples:\n\n```bash\ntime curl -i http://127.0.0.1/sleep/1     # The request takes about 1 second to finish.\ntime curl -i http://127.0.0.1/sleep/1.500 # The request takes about 1.5 seconds to finish.\ntime curl -i http://127.0.0.1/sleep/2     # The request takes about 2 seconds to finish.\n```\n\n### Endpoint `/delay/:period/:url`\n\nThe request will be delayed for the specified period of time, in seconds, and then forwarded to the specified URL.\nIt only supports HTTP and HTTPS protocols. Here are some examples:\n\n```bash\n# The request is forwarded to http://example.com in 1 second.\ntime curl -svfL http://127.0.0.1/delay/1/http://example.com\n\n# The request is forwarded to https://nginx.org/en/ in 2 seconds.\ntime curl -svfL http://127.0.0.1/delay/2/https://nginx.org/en/\n```\n\n## Alternatives\n\n* [Deelay][3]: Inline delay proxy for http resources. Written in Node.js.\n* [http-delayed-response][4]: A fast and easy way to delay a response until results are available. Written in Node.js.\n\n[1]: https://github.com/openresty/echo-nginx-module\n[2]: https://github.com/openresty/lua-nginx-module\n[3]: https://github.com/biesiad/deelay\n[4]: https://github.com/extrabacon/http-delayed-response\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeminy%2Fdocker-delayed-http-response","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeminy%2Fdocker-delayed-http-response","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeminy%2Fdocker-delayed-http-response/lists"}