44 lines
1.1 KiB
JavaScript
44 lines
1.1 KiB
JavaScript
// BastionGuard - Secure Payments PAC
|
|
// Generated from payments.json
|
|
|
|
function dnsDomainIs(host, domain) {
|
|
return host === domain || (host.length > domain.length && host.substring(host.length - domain.length - 1) === "." + domain);
|
|
}
|
|
|
|
function FindProxyForURL(url, host) {
|
|
host = host.toLowerCase();
|
|
|
|
// bypass locali
|
|
if (isPlainHostName(host) ||
|
|
shExpMatch(host, "localhost") ||
|
|
shExpMatch(host, "127.*") ||
|
|
shExpMatch(host, "10.*") ||
|
|
shExpMatch(host, "192.168.*") ||
|
|
shExpMatch(host, "172.16.*") || shExpMatch(host, "172.17.*") || shExpMatch(host, "172.18.*") ||
|
|
shExpMatch(host, "172.19.*") || shExpMatch(host, "172.2?.*") || shExpMatch(host, "172.3?.*")) {
|
|
return "DIRECT";
|
|
}
|
|
|
|
// domini pagamento (iniettati)
|
|
var pay = [
|
|
"paypal.com",
|
|
"stripe.com",
|
|
"adyen.com",
|
|
"klarna.com",
|
|
"checkout.com",
|
|
"worldpay.com",
|
|
"braintreepayments.com",
|
|
"braintreegateway.com",
|
|
"amazonpay.com",
|
|
"pay.google.com",
|
|
"pay.apple.com"
|
|
];
|
|
|
|
for (var i = 0; i < pay.length; i++) {
|
|
if (dnsDomainIs(host, pay[i])) {
|
|
return "PROXY 127.0.0.1:3129; DIRECT";
|
|
}
|
|
}
|
|
|
|
return "DIRECT";
|
|
}
|