-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.pac
34 lines (25 loc) · 990 Bytes
/
example.pac
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
function FindProxyForURL(url, host) {
if (isPlainHostName(host) || shExpMatch(host, "*.youtube.*") || shExpMatch(host, "*.googlevideo.com") || shExpMatch(host, "video.google.com") || shExpMatch(host, "video.l.google.com"))
return "DIRECT";
if (url.substring(0, 5) != "http:" && url.substring(0, 6) != "https:")
return "DIRECT";
let matchUrls = ["redash-demo.broknus.com","calendly.com","*.calendly.com","6sc.co","*.6sc.co","*.hubspot.com", "demo3.nullafi.net"];
let bypassUrls = [];
if (bypassUrls.length > 0 && isInList(host, bypassUrls)) {
return "DIRECT";
}
if (matchUrls.length > 0 && isInList(host, matchUrls)) {
return "PROXY demo3.nullafi.net:44509";
}
return "DIRECT";
}
function isInList(url, list) {
for (var i = 0; i < list.length; i++) {
if (shExpMatch(url, list[i])) {
alert(url + " " + list[i] + " true");
return true;
}
alert(url + " " + list[i] + " false");
}
return false;
}