{"id":13678869,"url":"https://github.com/LordotU/corsyusha","last_synced_at":"2025-04-29T15:33:36.444Z","repository":{"id":48270290,"uuid":"179544680","full_name":"LordotU/corsyusha","owner":"LordotU","description":"Simple and fast proxy to bypass CORS issues during prototyping against existing APIs without having to worry about CORS","archived":false,"fork":false,"pushed_at":"2021-08-03T20:12:31.000Z","size":2028,"stargazers_count":7,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-02-29T06:37:53.517Z","etag":null,"topics":["access-control-allow-origin","cors","cors-proxy","cors-proxy-server","fastify","nodejs","proxy"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/corsyusha","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/LordotU.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}},"created_at":"2019-04-04T17:28:36.000Z","updated_at":"2022-11-21T17:00:43.000Z","dependencies_parsed_at":"2022-09-10T21:21:04.276Z","dependency_job_id":null,"html_url":"https://github.com/LordotU/corsyusha","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/LordotU%2Fcorsyusha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LordotU%2Fcorsyusha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LordotU%2Fcorsyusha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LordotU%2Fcorsyusha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LordotU","download_url":"https://codeload.github.com/LordotU/corsyusha/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224179175,"owners_count":17269019,"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":["access-control-allow-origin","cors","cors-proxy","cors-proxy-server","fastify","nodejs","proxy"],"created_at":"2024-08-02T13:00:59.285Z","updated_at":"2025-04-29T15:33:36.414Z","avatar_url":"https://github.com/LordotU.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Corsyusha — Local CORS Proxy\n\n[![License](https://img.shields.io/badge/License-MIT-000000.svg)](https://opensource.org/licenses/MIT)\n[![Build Status](https://travis-ci.org/LordotU/corsyusha.svg?branch=master)](https://travis-ci.org/LordotU/corsyusha)\n[![Coverage Status](https://coveralls.io/repos/github/LordotU/corsyusha/badge.svg)](https://coveralls.io/github/LordotU/corsyusha)\n\n## Description\n\nSimple and fast (built on top of [fastify](https://www.npmjs.com/package/fastify) proxy to bypass [CORS](https://developer.mozilla.org/ru/docs/Web/HTTP/CORS) issues during prototyping against existing APIs without having to worry about CORS\n\nThis module was built to solve the issue of getting errors like this:\n\n```text\n... has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.\n```\n\n## Installation\n\n```bash\nnpm install -g corsyusha\n# or\nyarn global add corsyusha\n```\n\n## Testing\n\n```bash\nyarn test:jest # Runs Jest with coverage collection\nyarn test:coverage # Sends coverage to .coveralls.io\nyarn test # yarn test:jest \u0026\u0026 yarn test:coverage\n```\n\n## Usage\n\nLet's imagine API endpoint that we want to request that has CORS issues:\n\n```text\nhttps://licenseapi.herokuapp.com/licenses/mit\n```\n\nStart Proxy:\n\n```bash\ncorsyusha --url https://licenseapi.herokuapp.com\n```\n\nOr:\n\n```bash\nCORSYUSHA_URL=https://licenseapi.herokuapp.com corsyusha\n```\n\nOr you may pull Docker image and run a container:\n\n```bash\ndocker pull lordotu/corsyusha\n\ndocker run -dti \\\n  -e CORSYUSHA_URL=https://licenseapi.herokuapp.com \\\n  -e CORSYUSHA_HOST=0.0.0.0 \\\n  -p 8118:8118 \\\n  --name corsyusha \\\n  lordotu/corsyusha\n```\n\nThen in your client code, new API endpoint:\n\n```text\nhttp://localhost:8118/proxy/licenses/mit\n```\n\nEnd result will be a request to `https://licenseapi.herokuapp.com/licenses/mit` without the CORS issues!\n\nAlternatively you can install the package locally:\n\n```bash\nnpm install corsyusha\n# or\nyarn add corsyusha\n```\n\nAnd add a script to your project:\n\n```json\n \"scripts\": {\n   \"proxy\": \"corsyusha --url https://licenseapi.herokuapp.com\"\n }\n```\n\nOr:\n\n```json\n \"scripts\": {\n   \"proxy\": \"CORSYUSHA_URL=https://licenseapi.herokuapp.com corsyusha\"\n }\n```\n\n## Configuring\n\nYou may set params via command line args or via env variables. All defaults are stored in `.env` file in the root directory.\n\nOnly one argument is **required**: `--url` (or `CORSYUSHA_URL` if you prefer env variables).\n\n### Options\n\n| Option          | Shorthand | Example                           |   Default |\n|-----------------|-----------|-----------------------------------|----------:|\n| --url           | -u        | https://licenseapi.herokuapp.com  |           |\n| --port          | -p        | 8119                              |      8118 |\n| --host          | -h        | 0.0.0.0                           | localhost |\n| --urlSection    | -s        | trhough                           |     proxy |\n| --serverLogging | -l        | true                              |     false |\n| --headers       |           | {\"X-Requested-With\": \"Corsyusha\"} |        {} |\n| --headers       |           | {\"X-Requested-With\": \"Corsyusha\"} |        {} |\n| --origin        | -o        | http://127.0.0.1                  |         * |\n| --reflectOrigin | -r        | true                              |     false |\n\n### Environment variables\n\n| Option                   | Example                           |   Default |\n|--------------------------|-----------------------------------|----------:|\n| CORSYUSHA_URL            | https://licenseapi.herokuapp.com  |           |\n| CORSYUSHA_PORT           | 8119                              |      8118 |\n| CORSYUSHA_HOST           | 0.0.0.0                           | localhost |\n| CORSYUSHA_URL_SECTION    | trhough                           |     proxy |\n| CORSYUSHA_SERVER_LOGGING | true                              |     false |\n| CORSYUSHA_HEADERS        | {\"X-Requested-With\": \"Corsyusha\"} |        {} |\n| CORSYUSHA_ORIGIN         | http://127.0.0.1                  |         * |\n| CORSYUSHA_REFLECT_ORIGIN | true                              |     false |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLordotU%2Fcorsyusha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLordotU%2Fcorsyusha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLordotU%2Fcorsyusha/lists"}