4
4
< meta charset ="utf-8 " />
5
5
< title > PHP Cross-Origin Proxy test page</ title >
6
6
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 >
30
13
</ head >
31
- < body >
14
+ < body spellcheck ="false ">
15
+
32
16
< 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 >
35
19
20
+ < h2 > Proxy whitelist</ h2 >
21
+ < pre id ="whitelist "> </ pre >
36
22
37
23
< h2 > Examples</ h2 >
38
- < pre class ="prettyprint " style ="border:0;padding:0 ">
24
+
25
+
26
+ < pre contenteditable >
39
27
// GET, plain, no nothing
40
28
$.get('http://example.com')
29
+ </ pre >
30
+
41
31
32
+ < pre contenteditable >
42
33
// GET, with a custom header, a proxied cookie, and some parameters using both url and data property
43
34
$.ajax({
44
35
method: 'GET',
@@ -49,29 +40,38 @@ <h2>Examples</h2>
49
40
'X-Proxy-Cookie': 'jsessionid=AS348AF929FK219CKA9FK3B79870H;',
50
41
},
51
42
})
43
+ </ pre >
52
44
45
+
46
+ < pre contenteditable >
53
47
// POST, with both post data in property and a get parameter in the url
54
48
$.ajax({
55
49
method: 'POST',
56
50
url: 'http://localhost/php-cross-domain-proxy/test/echo.php?c=3',
57
51
data: {a:1, b:2},
58
52
})
53
+ </ pre >
59
54
55
+
56
+ < pre contenteditable >
60
57
// PUT, with data encoded as json
61
58
$.ajax({
62
59
method: 'PUT',
63
60
url: 'http://localhost/php-cross-domain-proxy/test/echo.php',
64
61
contentType: 'application/json',
65
62
data: JSON.stringify({a:1, b:2}),
66
63
})
64
+ </ pre >
67
65
66
+
67
+ < pre contenteditable >
68
68
// DELETE, with get parameter
69
69
$.ajax({
70
70
method: 'DELETE',
71
71
url: 'http://localhost/php-cross-domain-proxy/test/echo.php?id=1',
72
72
})
73
-
74
73
</ pre >
75
74
75
+
76
76
</ body >
77
77
</ html >
0 commit comments