-
Notifications
You must be signed in to change notification settings - Fork 2
/
magicproxyrc.example
42 lines (41 loc) · 1.2 KB
/
magicproxyrc.example
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
{
plugins: [
"./log.js",
"./replace.js",
"./fakeDir.js"
],
markup: [
{
hrefRegExp: "http://(www\\.)?example.com/",
replace: {
what: "h1",
markup: "<h1>Hello from magicProxy!</h1>"
}
}, {
hrefRegExp: "http://(www\\.)?example.com/",
insert: {
markup: "<p><small>This paragraph was inserted through magicProxy. You can edit magicproxyrc.example (without restarting magicProxy) and see this change.</small></p>",
after: "h1"
}
}
],
fakeDir: [
{
"url": "http://www.example.com/static/files/",
"dir": "/path/to/my/version/of/those/files/",
"contentType": "text/javascript"
}
],
replace: [
{
replace: "http://www.example.com/js/main.js",
with: "alert('Hey it seems like the proxy works!');",
contentType: "text/javascript"
},
{
replaceRegExp: "^http://www.example.com/css/(.*?).min.css$",
withFile: "/path/to/unminified/$1.css",
contentType: "text/css"
}
]
}