https://github.com/fakeheal/cors-anywhere
cors-anywhere is a php reverse proxy which adds CORS headers to the proxy request.
https://github.com/fakeheal/cors-anywhere
enable-cors php php-cross-domain php-proxy
Last synced: 3 months ago
JSON representation
cors-anywhere is a php reverse proxy which adds CORS headers to the proxy request.
- Host: GitHub
- URL: https://github.com/fakeheal/cors-anywhere
- Owner: fakeheal
- Created: 2023-06-14T19:08:21.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-25T06:55:00.000Z (7 months ago)
- Last Synced: 2024-10-30T07:06:27.643Z (7 months ago)
- Topics: enable-cors, php, php-cross-domain, php-proxy
- Language: PHP
- Homepage:
- Size: 78.1 KB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cors-anywhere
[](https://github.com/fakeheal/cors-anywhere/actions/workflows/php.yml)
[](https://packagist.org/packages/fakeheal/cors-anywhere)
[](https://packagist.org/packages/fakeheal/cors-anywhere)
[](https://packagist.org/packages/fakeheal/cors-anywhere)
[](https://packagist.org/packages/fakeheal/cors-anywhere)`cors-anywhere` is a php reverse proxy which adds CORS headers to the proxy request.
## Use Case
It can be used to access resources from third party websites when it's not possible to enable CORS on target website
i.e. when you don't own that website._Note from author:_ I am currently using to access **Rescue Time**'s & **trak.tv** APIs, so I can sync my own data to [conjure.so](https://conjure.so).
## Documentation
### Install
```sh
composer require fakeheal/cors-anywhere
```### Initialize
```php
handle();
} catch (CorsAnywhereException $e) {
die($e->getMessage()); // or die trying
}
```
### How to use
Once setup, you must pass a url parameter, for example if your Cors URL is the following: `http://127.0.0.1:2000`
Then you'd do the below, the url being the proxied site you want to use.```
http://127.0.0.1:2000/?url=https://google.com
```## Acknowledgements
- [cors-anywhere, but for node js](https://github.com/Rob--W/cors-anywhere)
- [softius/php-cross-domain-proxy](https://github.com/softius/php-cross-domain-proxy)## Running Tests
To run tests, run the following command
```bash
./vendor/bin/pest
```## Used By
This project is used by the following entities:
- [Conjure Kit](conjure-kit.vercel.app)
## License
[MIT](https://choosealicense.com/licenses/mit/)