├── www
├── robots.txt
├── assets
│ └── default
│ │ ├── img
│ │ └── favicon.ico
│ │ ├── css
│ │ └── main.css
│ │ └── js
│ │ └── main.js
├── index.php
└── .htaccess
├── .vscode
└── settings.json
├── bin
├── cs.bat
├── test.bat
├── cs
└── test
├── src
├── Exception
│ ├── FileNotFoundException.php
│ └── MalformedConfigFileException.php
├── Helpers.php
├── Config.php
├── RequestHandler.php
└── Application.php
├── app
├── config
│ └── config.sample.ini
├── templates
│ └── default
│ │ ├── sitemap.pxml
│ │ ├── error.phtml
│ │ └── frontend.phtml
└── database
│ └── cors-proxy.sql
├── README.md
├── composer.json
└── LICENSE
/www/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Allow: /
3 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "editor.insertSpaces": true,
3 | "editor.tabSize": 4
4 | }
5 |
--------------------------------------------------------------------------------
/bin/cs.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | call %~dp0\..\vendor\bin\phpcs.bat -p --standard=PSR2 %~dp0\..\src %~dp0\..\tests
4 |
--------------------------------------------------------------------------------
/www/assets/default/img/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/htmldriven/cors-proxy/HEAD/www/assets/default/img/favicon.ico
--------------------------------------------------------------------------------
/bin/test.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | call %~dp0\..\vendor\bin\tester.bat -s -c %~dp0\..\tests\environment\php-win.ini %~dp0\..\tests -p php
4 |
--------------------------------------------------------------------------------
/bin/cs:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | _DIR=$(dirname $0);
4 |
5 | "$_DIR"/../vendor/bin/phpcs -p --standard=PSR2 "$_DIR"/../src "$_DIR"/../tests
6 |
--------------------------------------------------------------------------------
/bin/test:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | _DIR=$(dirname $0);
4 |
5 | "$_DIR"/../vendor/bin/tester -s -c "$_DIR"/../tests/environment/php-unix.ini "$_DIR"/../tests -p php
6 |
--------------------------------------------------------------------------------
/www/index.php:
--------------------------------------------------------------------------------
1 | run();
8 |
--------------------------------------------------------------------------------
/src/Exception/FileNotFoundException.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Version:
22 | 23 | -------------------------------------------------------------------------------- /www/.htaccess: -------------------------------------------------------------------------------- 1 | # Apache configuration file (see httpd.apache.org/docs/current/mod/quickreference.html) 2 | 3 | # disable directory listing 4 |CORS proxy is a free service for developers who need to bypass same-origin policy related to performing standard AJAX requests to 3rd party services.
72 |You can simply use this website as quickest way to finally start doing some cross-domain requests and even you can run this service on your own webserver. If you prefer running the service on your own, follow the instructions in Setup section.
73 |You can customize the service parameters to fit your own needs (including this front-end page template).
74 |The CORS proxy service expects you provide the URL of 3rd party service/page in url HTTP GET parameter by default. A final cross-domain request URL via the CORS proxy service can be handled, looks something like this:
/?getUrlParameterName(); ?>=https://www.htmldriven.com/sample.json80 | 81 |
You can test the CORS proxy service response using the form above.
83 |Read the following section if you want to run the CORS proxy on your own webserver.
88 | 89 |Please, check the composer.json file or packagist.org to see the current list of requirements in terms of packages which are required by composer. Except for PHP version >=5.6 with CURL extension being installed, there are no more odd requirements
91 | 92 |The best way to install the CORS proxy is using the composer. You can do that using the following command:
94 |composer create-project htmldriven/cors-proxy my-cors-proxy95 |
* Note that my-cors-proxy in the command above is the name of target directory for newly created CORS proxy project, so this name is totally up to you.
96 |Then, create a destination database using the cors-proxy.sql initialization script.
97 | 98 |If you need, you can customize the CORS proxy by creating custom config.ini file. This file must be located at app/config directory. There's already config.sample.ini file, which you can just copy and edit some parts of it to match your needs.
100 |There are several config items which you can change. The following list shows all supported options:
101 |urlParameterName = url - name of URL HTTP GET parameter nameuserAgent = htmldriven/cors-proxy 1.0 - HTTP User-Agent string which is used during cross-domain requeststemplateFile = app/templates/default/frontend.phtml - path to main front-end page template filesitemapPath = /sitemap.xml - URL path to sitemap filesitemapFile = app/templates/default/sitemap.pxml - path to sitemap XML template filetimezone = UTC - default PHP timezone settings used for DateTime instancesdatabase = ... - database connection settingsCORS proxy is totally free as it's available and being distributed under The MIT License.
115 |