Skip to content

Commit 03609c7

Browse files
committed
Minor improvents
1 parent e1e6d86 commit 03609c7

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
*Formerly known as "PHP Cross Domain (AJAX) Proxy"*
44

5-
A CORS proxy that allows cross domain requests. It can be used to access resources from third part websites when it's not possible to enable CORS.
5+
PHP CORS Proxy is a simple php script that allows cross domain requests. 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.
66

7-
**Note**: Please check whether this solution is indeed necessary by having a look at [how you can enable CORS on your server](http://enable-cors.org/server.html).
7+
**Note**: Please check whether this solution is indeed necessary by having a look on [how you can enable CORS on your server](http://enable-cors.org/server.html).
88

99
## Overview
1010

@@ -13,7 +13,8 @@ A CORS proxy that allows cross domain requests. It can be used to access resourc
1313

1414
* Acts as a reverse proxy: request headers and data are propagated from proxy to server. Similarly, response headers and data are propagated from proxy to client.
1515
* Provides support for all methods GET, POST, PUT, DELETE.
16-
* Requests can be filtered against a list of trusted domains / URLs.
16+
* Provides also support for HTTPS.
17+
* Requests can be filtered against a list of trusted domains or URLs.
1718
* External configuration (Work in progress)
1819
* Error handling i.e. when server is not available (Work in progress)
1920
* Debugging mode (Work in progress)
@@ -24,8 +25,8 @@ PHP Cors Proxy works with PHP 5.3+ or above.
2425

2526
### Author
2627

27-
Iacovos Constantinou - [email protected]
28-
See also the list of [contributors](https://github.com/softius/php-cross-domain-proxy/graphs/contributors) which participated in this project.
28+
* Iacovos Constantinou - [email protected]
29+
* See also the list of [contributors](https://github.com/softius/php-cross-domain-proxy/graphs/contributors) which participated in this project.
2930

3031

3132
### License
@@ -51,8 +52,8 @@ For security reasons don't forget to define all the trusted domains / URLs into
5152

5253
``` JAVASCRIPT
5354
$valid_requests = array(
54-
'http://www.domainA.com/',
55-
'http://www.domainB.com/path-to-services/service-a'
55+
'http://www.domainA.com/',
56+
'http://www.domainB.com/path-to-services/service-a'
5657
);
5758
```
5859

@@ -63,21 +64,21 @@ It is possible to initiate a cross domain request either by providing the `X-Pro
6364

6465
### Using headers
6566

66-
It is possible to specify the target URL with the `X-Proxy-URL` header, which might be easier to set with your JavaScript library. For example, if you wanted to automatically use the proxy for external URL targets, for GET and POST requests:
67+
It is possible to specify the target URL by using the `X-Proxy-URL` header, which might be easier to set with your JavaScript library. For example, if you wanted to automatically use the proxy for external URL targets, for GET and POST requests:
6768

6869
``` JAVASCRIPT
6970
$.ajaxPrefilter(function(options, originalOptions, jqXHR) {
70-
if (options.url.match(/^https?:/)) {
71-
options.headers['X-Proxy-URL'] = options.url;
72-
options.url = '/proxy.php';
73-
}
71+
if (options.url.match(/^https?:/)) {
72+
options.headers['X-Proxy-URL'] = options.url;
73+
options.url = '/proxy.php';
74+
}
7475
});
7576
```
7677

7778
The following example uses `curl`
7879

7980
```
80-
curl -v -H "X-Proxy-URL: http://cross-domain.com" http://mydomain.com/proxy.php
81+
curl -v -H "X-Proxy-URL: http://cross-domain.com" http://yourdomain.com/proxy.php
8182
```
8283

8384

@@ -87,17 +88,16 @@ In order to make a cross domain request, just make a request to http://www.yourd
8788

8889
``` JAVASCRIPT
8990
$('#target').load(
90-
'http://www.yourdomain.com/proxy.php', {
91-
csurl: 'http://www.cross-domain.com/',
92-
param1: value1,
93-
param2: value2
94-
}
91+
'http://www.yourdomain.com/proxy.php', {
92+
csurl: 'http://www.cross-domain.com/',
93+
param1: value1,
94+
param2: value2
95+
}
9596
);
9697
```
9798

9899
The following example uses `curl`
99100

100101
```
101-
curl -v http://mydomain.com/proxy.php?csurl=http://www.cross-domain.com/&param1=value1&param2=value2
102+
curl -v http://yourdomain.com/proxy.php?csurl=http://www.cross-domain.com/&param1=value1&param2=value2
102103
```
103-

0 commit comments

Comments
 (0)