44 < meta charset ="utf-8 " />
55 < title > PHP Cross-Origin Proxy test page</ title >
66
7- < style type ="text/css ">
8- html {font-family : sans-serif;}
9- body {margin : .5em 2em ;}
10- </ style >
11-
12- < script src ="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js "> </ script >
13- < script src ="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/run_prettify.js "> </ script >
14- < script >
15- $ ( function ( )
16- {
17- $ ( document ) . ajaxSend ( onAjaxSend ) ;
18- } ) ;
19-
20- function onAjaxSend ( event , jqxhr , options )
21- {
22- //if(options.crossDomain)
23- {
24- jqxhr . setRequestHeader ( 'X-Proxy-Url' , options . url ) ;
25- options . url = 'proxy.php' ;
26- options . url += '?_=' + Date . now ( ) ;
27- }
28- }
29- </ script >
7+ < link rel ="stylesheet " type ="text/css " href ="//cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.css ">
8+ < link rel ="stylesheet " type ="text/css " href ="index.css ">
9+
10+ < script src ="https://cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.js "> </ script >
11+ < script src ="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js "> </ script >
12+ < script src ="index.js " defer > </ script >
3013</ head >
31- < body >
14+ < body spellcheck ="false ">
15+
3216 < h1 > PHP Cross Domain Proxy test page</ h1 >
33- < p > A "jQuery enabled" test page where you can use the browser developer console to test .</ p >
34- < p > < em > All</ em > requests will be passed to the proxy so it can be tested even though requests aren't < em > actually</ em > cross-domain.</ p >
17+ < p > A "jQuery enabled" test page. Edit an example and push 🛫, or just use the browser developer console.</ p >
18+ < p > < em > All</ em > requests will be sent through the proxy even if not < em > actually</ em > cross-domain, since this is a test page for that proxy .</ p >
3519
20+ < h2 > Proxy whitelist</ h2 >
21+ < pre id ="whitelist "> </ pre >
3622
3723 < h2 > Examples</ h2 >
38- < pre class ="prettyprint " style ="border:0;padding:0 ">
24+
25+
26+ < pre contenteditable >
3927// GET, plain, no nothing
4028$.get('http://example.com')
29+ </ pre >
30+
4131
32+ < pre contenteditable >
4233// GET, with a custom header, a proxied cookie, and some parameters using both url and data property
4334$.ajax({
4435 method: 'GET',
@@ -49,29 +40,38 @@ <h2>Examples</h2>
4940 'X-Proxy-Cookie': 'jsessionid=AS348AF929FK219CKA9FK3B79870H;',
5041 },
5142})
43+ </ pre >
5244
45+
46+ < pre contenteditable >
5347// POST, with both post data in property and a get parameter in the url
5448$.ajax({
5549 method: 'POST',
5650 url: 'http://localhost/php-cross-domain-proxy/test/echo.php?c=3',
5751 data: {a:1, b:2},
5852})
53+ </ pre >
5954
55+
56+ < pre contenteditable >
6057// PUT, with data encoded as json
6158$.ajax({
6259 method: 'PUT',
6360 url: 'http://localhost/php-cross-domain-proxy/test/echo.php',
6461 contentType: 'application/json',
6562 data: JSON.stringify({a:1, b:2}),
6663})
64+ </ pre >
6765
66+
67+ < pre contenteditable >
6868// DELETE, with get parameter
6969$.ajax({
7070 method: 'DELETE',
7171 url: 'http://localhost/php-cross-domain-proxy/test/echo.php?id=1',
7272})
73-
7473</ pre >
7574
75+
7676</ body >
7777</ html >
0 commit comments