Skip to content

Commit e4c0206

Browse files
committed
Added test proxy to make sure the class and auto-loading works
1 parent 8cfbdd4 commit e4c0206

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

test/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
//if(options.crossDomain)
2323
{
2424
jqxhr.setRequestHeader('X-Proxy-URL', options.url);
25-
options.url = '../proxy.php';
25+
options.url = 'proxy.php';
2626
options.url += '?_='+Date.now();
2727
}
2828
}
@@ -38,7 +38,7 @@ <h2>Examples</h2>
3838
<pre class="prettyprint" style="border:0;padding:0">
3939
// GET, no parameters
4040
$.ajax({
41-
url: 'http://localhost/php-cross-domain-proxy/test/echo.php',
41+
url: 'http://example.com',
4242
})
4343

4444
// GET, with custom header and some parameters using both url and data property

test/proxy.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
require '../vendor/autoload.php';
4+
5+
CrossOriginProxy::proxy([
6+
// Exact matching
7+
['http://www.yr.no/place/Sweden/Stockholm/Stockholm/forecast.xml'],
8+
9+
// URL component matching
10+
['host' => 'localhost'],
11+
['host' => 'example.com', 'scheme' => 'http'],
12+
13+
// Regex matching
14+
['regex' => '%^http://www.yr.no/place/Norway/%'],
15+
16+
]);

0 commit comments

Comments
 (0)