Skip to content

ThreeWiseMen/php_cors_proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

PHP CORS Proxy

The intent of the PHP CORS Proxy is to be a simple re-usable script you drop onto a PHP server to avoid CORS requests in Javascript Ajax applications.

The script will proxy requests to the origin server and deliver back that servers responses as if it were local.

$pcpconf = new PHPCorsProxyConfig();
$pcpconf->addProxy("http://origin-website.com", "prefix");
$proxy = new PHPCORSProxy($pcpconf);
$proxy->serviceRequest();

This would set up a configuration where:

http://main-website.com/phpcorsproxy.php/prefix/api/method/parameters?other=params

would broker to

http://origin-website.com/api/method/parameters?other=params

You may wish to utilize an .htaccess file to hide the exposure of the proxy script's filename.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages