This commit is contained in:
2025-01-31 16:20:37 +03:00
parent d6148e8cd8
commit 0431d24d11

View File

@@ -28,6 +28,7 @@ function FindProxyForURL(url, host) {
"imdb.com", "*.imdb.com",
"themoviedb.org", "*.themoviedb.org",
"intel.com", "*.intel.com",
"docker.com", "*.docker.com",
"terraform.io", "*.terraform.io"
];
@@ -39,6 +40,12 @@ function FindProxyForURL(url, host) {
"jnn-pa.googleapis.com", "l.google.com"
];
// Domains that should go directly (without proxy)
var directDomains = [
"mail.google.com", "meet.google.com",
"zblv.ru", "*.zblv.ru"
];
// Function to check if host matches any pattern
function matchesAny(host, patterns) {
for (var i = 0; i < patterns.length; i++) {
@@ -49,17 +56,21 @@ function FindProxyForURL(url, host) {
return false;
}
// Check if the host matches any domain in the list
// Ensure anything in the `.vm` domain goes direct
if (shExpMatch(host, "*.vm") || shExpMatch(host, "zblv.ru") || shExpMatch(host, "*.zblv.ru")) {
return "DIRECT";
}
// Direct connection for specific domains
if (matchesAny(host, directDomains)) {
return "DIRECT";
}
// Proxy for matched domains
if (matchesAny(host, proxyDomains) || matchesAny(host, googleDomains)) {
return proxy;
}
// Direct connection for specific Google services
if (shExpMatch(host, "mail.google.com") || shExpMatch(host, "meet.google.com")) {
return "DIRECT";
}
// Default: no proxy
return "DIRECT";
}
}