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