Skip to content

Commit 6f37dc1

Browse files
committed
installation / configuration instructions
1 parent d229d48 commit 6f37dc1

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

README.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,34 @@
1-
php-cross-domain-proxy
2-
======================
1+
PHP Cross Domain (AJAX) Proxy
2+
==============
3+
4+
An application proxy that can be used to transparently transfer any request ( including of course XMLHTTPRequest ) to any third part domain. It is possible to define a list of acceptable third party domains and you are encouraged to do so. Otherwise the proxy is open to any kind of requests.
5+
6+
Installation
7+
--------------
8+
9+
The proxy is indentionally limited to a single file. All you have to do is to place `proxy.php` under your application
10+
11+
Whenever you want to make a cross domain request, just make a request to http://www.yourdomain.com/ajax-proxy.php and specify the cross domain URL by using `csurl` parameter. Obviously, you can add more parameters according to your needs; note that the rest of the parameters will be used in the cross domain request. For instance, if you are using jQuery:
12+
13+
$('#target').load(
14+
'http://www.yourdomain.com/ajax-proxy.php', {
15+
csurl: 'http://www.cross-domain.com/',
16+
param1: value1,
17+
param2: value2
18+
}
19+
);
20+
21+
It’s worth mentioning that both POST and GET methods work and headers are taken into consideration. That is to say, headers sent from browser to proxy are used in the cross domain request and vice versa.
22+
23+
Configuration
24+
--------------
25+
26+
For security reasons don't forget to define all the valid requests into top section of `proxy.php` file:
27+
28+
$valid_requests = array(
29+
'http://www.domainA.com/',
30+
'http://www.domainB.com/path-to-services/service-a'
31+
);
32+
33+
34+

0 commit comments

Comments
 (0)