Skip to content

Commit 65703a5

Browse files
committed
Updated README.md
1 parent da89536 commit 65703a5

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ the [geekality/php-cross-domain-proxy](https://packagist.org/packages/geekality/
3939
And then for example add a `proxy.php` like this to your web application:
4040

4141
``` PHP
42-
<?php
43-
require 'vendor/autoload.php';
42+
<?php
43+
require 'vendor/autoload.php';
4444

45-
CrossOriginProxy::proxy([
46-
['host' => 'example.com'],
47-
]);
45+
Geekality\CrossOriginProxy::proxy([
46+
['host' => 'example.com'],
47+
]);
4848

4949
```
5050

@@ -144,7 +144,7 @@ The requested URL must match at least one of the whitelisted criterias to be acc
144144

145145
require 'vendor/autoload.php';
146146

147-
CrossOriginProxy::proxy([
147+
Geekality\CrossOriginProxy::proxy([
148148

149149
// URL component matching
150150
['host' => 'localhost'],
@@ -180,3 +180,19 @@ $.ajax({
180180
}
181181
})
182182
```
183+
184+
cURL and zlib options
185+
---
186+
187+
You can add options which will be appended to the options set when doing the request. You can also turn off zlib compression, which is enabled by default.
188+
189+
``` PHP
190+
<?php
191+
require 'vendor/autoload.php';
192+
193+
$whitelist = [...];
194+
$opts = [CURLOPT_TIMEOUT => 5];
195+
$zlib = 'Off'
196+
197+
Geekality\CrossOriginProxy::proxy($whitelist, $opts, $zlib);
198+
```

0 commit comments

Comments
 (0)