forked from softius/php-cross-domain-proxy
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathindex.html
75 lines (59 loc) · 1.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>PHP Cross-Origin Proxy test page</title>
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.css">
<link rel="stylesheet" type="text/css" href="index.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="index.js" defer></script>
</head>
<body spellcheck="false">
<h1>PHP Cross Domain Proxy test page</h1>
<p>Edit an example and push 🛫, or just use the browser developer console.</p>
<p>The proxy is configured with the below whitelist.</p>
<pre id="whitelist"></pre>
<h2>Examples</h2>
<pre contenteditable>
// GET, plain and simple
$.get('https://example.com')
</pre>
<pre contenteditable>
// GET, with a custom header, a proxied cookie, and some parameters using both url and data property
$.ajax({
method: 'GET',
url: 'http://localhost/php-cross-domain-proxy/test/echo.php?c=3',
data: {a:1, b:2},
headers: {
'X-TestRequestHeader': 'Fluffy bunny',
'X-Proxy-Cookie': 'jsessionid=AS348AF929FK219CKA9FK3B79870H;',
},
})
</pre>
<pre contenteditable>
// POST, with both post data in property and a get parameter in the url
$.ajax({
method: 'POST',
url: 'http://localhost/php-cross-domain-proxy/test/echo.php?c=3',
data: {a:1, b:2},
})
</pre>
<pre contenteditable>
// PUT, with data encoded as json
$.ajax({
method: 'PUT',
url: 'http://localhost/php-cross-domain-proxy/test/echo.php',
contentType: 'application/json',
data: JSON.stringify({a:1, b:2}),
})
</pre>
<pre contenteditable>
// DELETE, with get parameter
$.ajax({
method: 'DELETE',
url: 'http://localhost/php-cross-domain-proxy/test/echo.php?id=1',
})
</pre>
</body>
</html>