{"id":20895056,"url":"https://github.com/topheman/delay-proxy","last_synced_at":"2025-04-11T03:41:55.398Z","repository":{"id":145502955,"uuid":"147108677","full_name":"topheman/delay-proxy","owner":"topheman","description":"Delay specific requests with custom delay - perfect for development","archived":false,"fork":false,"pushed_at":"2023-06-15T08:49:05.000Z","size":98,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T23:46:23.780Z","etag":null,"topics":["delay","proxy","server","timeout"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/topheman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-09-02T17:53:17.000Z","updated_at":"2025-03-26T01:50:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"57c890db-a8bc-4572-82af-ae5be95fcf93","html_url":"https://github.com/topheman/delay-proxy","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topheman%2Fdelay-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topheman%2Fdelay-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topheman%2Fdelay-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topheman%2Fdelay-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/topheman","download_url":"https://codeload.github.com/topheman/delay-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339287,"owners_count":21087213,"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":["delay","proxy","server","timeout"],"created_at":"2024-11-18T10:24:41.155Z","updated_at":"2025-04-11T03:41:55.368Z","avatar_url":"https://github.com/topheman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# delay-proxy\n\n[![npm version](https://badge.fury.io/js/delay-proxy.svg)](https://www.npmjs.com/package/delay-proxy)\n\nYou may know and use the chrome dev tools and its _Network_ tab where you can [emulate slow network connections](https://developers.google.com/web/tools/chrome-devtools/network-performance/reference#throttling). The problem is that it applies to all requests, you can't emulate together:\n\n- a slow network\n- a slow api.foo.com in general\n- only a very slow endpoint on api.bar.com\n\nWith `delay-proxy`, you can proxy your requests specifying a delay and a url.\n\nhttp://localhost:8001/delay/{delay-in-ms}/{url}\n\nExample calls:\n\n- image: http://localhost:8001/delay/2000/https://via.placeholder.com/350x150/F00000/FFFFFF?text=Hello+world\n- json: `curl http://localhost:8001/delay/1000/https://jsonplaceholder.typicode.com/posts/1/comments`\n\n## Usage\n\n### Command line\n\n#### Install globally\n\n```shell\nnpm install -g delay-proxy\n```\n\nOnce that done, you can launch it from anywhere with:\n\n```shell\ndelay-proxy\n```\n\nAvailable options:\n\n- `delay-proxy --help`\n- `delay-proxy --version`\n- `delay-proxy --port 9000`: lets you specify which port you want to use (default: `8001`)\n\n#### Install locally\n\nYou might not like to install the package globally or wanna ship and use this package as a dev dependency in your project:\n\n```shell\nnpm install --save-dev delay-proxy\n```\n\nRun it using [npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) (an npm package runner shipped with npm since v5.2.0):\n\n```shell\nnpx delay-proxy\n```\n\n### As a module\n\n`delay-proxy` also works as a required module.\n\n```js\nconst PORT = 8001;\nconst LOCAL_IP = require(\"my-local-ip\")(); // optional\n\nconst { makeServer } = require(\"delay-proxy\");\n\nmakeServer({ port: PORT, localIp: LOCAL_IP }).listen(PORT, () =\u003e\n  console.log(\n    \"delay-proxy now listening on\",\n    `http://localhost:${PORT}`,\n    `${LOCAL_IP}:${PORT}`\n  )\n);\n```\n\n## Contributing\n\n1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device\n2. Uninstall `delay-proxy` if it's already installed: `npm uninstall -g delay-proxy`\n3. Link it to the global module directory: `npm link`\n\nAfter that, you can use the `delay-proxy` command everywhere.\n\n### Only contribute on the server\n\nIf your feature/fix isn't about the cli but the server, you don't need to `npm link`. Make sure you `npm install` then run:\n\n```\nnpm run dev\n```\n\nThis will launch the server and reload it when you update the source code, thanks to [nodemon](https://www.npmjs.com/package/nodemon).\n\n### Contributing guidelines\n\n- follow the [AngularJS git commit guidelines](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits) for your commit messages (it make it easier to generate changelog)\n  - to generate changelog: `npm run generate-changelog -- v1.1.0 v1.2.0`\n- your code will automatically be:\n  - linted by [eslint](https://eslint.org/)\n  - formatted by [prettier](https://prettier.io/)\n\n## Author\n\nChristophe Rosset ([@topheman](https://twitter.com/topheman)) - [labs.topheman.com](http://labs.topheman.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftopheman%2Fdelay-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftopheman%2Fdelay-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftopheman%2Fdelay-proxy/lists"}