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

139
proxy.pac
View File

@@ -1,65 +1,76 @@
function FindProxyForURL(url, host) { function FindProxyForURL(url, host) {
var proxy = "PROXY proxy.vm:8118"; var proxy = "PROXY proxy.vm:8118";
// Domains that should go through the proxy // Domains that should go through the proxy
var proxyDomains = [ var proxyDomains = [
"linkedin.com", "www.linkedin.com", "linkedin.com", "www.linkedin.com",
"rutracker.org", "*.rutracker.*", "rutracker.org", "*.rutracker.*",
"2ip.ru", "2ip.ru",
"kinozal.tv", "*.kinozal.tv", "kinozal.tv", "*.kinozal.tv",
"ntc.party", "ntc.party",
"instagram.com", "*.instagram.com", "*.cdninstagram.com", "instagram.com", "*.instagram.com", "*.cdninstagram.com",
"chatgpt.com", "*.chatgpt.com", "openai.com", "*.openai.com", "chatgpt.com", "*.chatgpt.com", "openai.com", "*.openai.com",
"digitalocean.com", "*.digitalocean.com", "digitalocean.com", "*.digitalocean.com",
"cisco.com", "*.cisco.com", "cisco.com", "*.cisco.com",
"medium.com", "*.medium.com", "medium.com", "*.medium.com",
"homarr.dev", "*.homarr.dev", "homarr.dev", "*.homarr.dev",
"netgate.com", "*.netgate.com", "netgate.com", "*.netgate.com",
"boostymark.com", "*.boostymark.com", "boostymark.com", "*.boostymark.com",
"discord.com", "*.discord.com", "discord.gg", "*.discord.gg", "discord.com", "*.discord.com", "discord.gg", "*.discord.gg",
"notepad-plus-plus.org", "*.notepad-plus-plus.org", "notepad-plus-plus.org", "*.notepad-plus-plus.org",
"clickhouse.com", "*.clickhouse.com", "clickhouse.com", "*.clickhouse.com",
"hashicorp.com", "*.hashicorp.com", "hashicorp.com", "*.hashicorp.com",
"vagrantup.com", "*.vagrantup.com", "vagrantup.com", "*.vagrantup.com",
"vagrantcloud.com", "*.vagrantcloud.com", "vagrantcloud.com", "*.vagrantcloud.com",
"turnkeylinux.org", "*.turnkeylinux.org", "turnkeylinux.org", "*.turnkeylinux.org",
"habr.com", "*.habr.com", "habr.com", "*.habr.com",
"giters.com", "*.giters.com", "giters.com", "*.giters.com",
"imdb.com", "*.imdb.com", "imdb.com", "*.imdb.com",
"themoviedb.org", "*.themoviedb.org", "themoviedb.org", "*.themoviedb.org",
"intel.com", "*.intel.com", "intel.com", "*.intel.com",
"terraform.io", "*.terraform.io" "docker.com", "*.docker.com",
]; "terraform.io", "*.terraform.io"
];
var googleDomains = [
"youtube.com", "*.youtube.com", "*.youtu.be", "youtu.be", var googleDomains = [
"*.ytimg.com", "*.ggpht.com", "*.googleusercontent.com", "youtube.com", "*.youtube.com", "*.youtu.be", "youtu.be",
"*.googlevideo.com", "google.com", "*.google.com", "*.ytimg.com", "*.ggpht.com", "*.googleusercontent.com",
"*.yt.be", "yt.be", "*.l.google.com", "*.googlevideo.com", "google.com", "*.google.com",
"jnn-pa.googleapis.com", "l.google.com" "*.yt.be", "yt.be", "*.l.google.com",
]; "jnn-pa.googleapis.com", "l.google.com"
];
// Function to check if host matches any pattern
function matchesAny(host, patterns) { // Domains that should go directly (without proxy)
for (var i = 0; i < patterns.length; i++) { var directDomains = [
if (shExpMatch(host, patterns[i])) { "mail.google.com", "meet.google.com",
return true; "zblv.ru", "*.zblv.ru"
} ];
}
return false; // Function to check if host matches any pattern
} function matchesAny(host, patterns) {
for (var i = 0; i < patterns.length; i++) {
// Check if the host matches any domain in the list if (shExpMatch(host, patterns[i])) {
if (matchesAny(host, proxyDomains) || matchesAny(host, googleDomains)) { return true;
return proxy; }
} }
return false;
// Direct connection for specific Google services }
if (shExpMatch(host, "mail.google.com") || shExpMatch(host, "meet.google.com")) {
return "DIRECT"; // Ensure anything in the `.vm` domain goes direct
} if (shExpMatch(host, "*.vm") || shExpMatch(host, "zblv.ru") || shExpMatch(host, "*.zblv.ru")) {
return "DIRECT";
// Default: no proxy }
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;
}
// Default: no proxy
return "DIRECT";
}