This commit is contained in:
2025-01-31 15:38:55 +03:00
parent 1b8fdbeb84
commit d6148e8cd8

View File

@@ -1,34 +1,35 @@
function FindProxyForURL(url, host) { function FindProxyForURL(url, host) {
var proxy = "PROXY proxy.vm:8118"; var proxy = "PROXY proxy.vm:8118";
var proxyDomains = { // Domains that should go through the proxy
"linkedin.com": 1, var proxyDomains = [
"rutracker.org": 1, "*.rutracker.*": 1, "linkedin.com", "www.linkedin.com",
"2ip.ru": 1, "rutracker.org", "*.rutracker.*",
"kinozal.tv": 1, "*.kinozal.tv": 1, "2ip.ru",
"ntc.party": 1, "kinozal.tv", "*.kinozal.tv",
"instagram.com": 1, "*.instagram.com": 1, "*.cdninstagram.com": 1, "ntc.party",
"chatgpt.com": 1, "openai.com": 1, "*.openai.com": 1, "*.chatgpt.com": 1, "instagram.com", "*.instagram.com", "*.cdninstagram.com",
"digitalocean.com": 1, "*.digitalocean.com": 1, "chatgpt.com", "*.chatgpt.com", "openai.com", "*.openai.com",
"cisco.com": 1, "*.cisco.com": 1, "digitalocean.com", "*.digitalocean.com",
"medium.com": 1, "*.medium.com": 1, "cisco.com", "*.cisco.com",
"homarr.dev": 1, "*.homarr.dev": 1, "medium.com", "*.medium.com",
"netgate.com": 1, "*.netgate.com": 1, "homarr.dev", "*.homarr.dev",
"boostymark.com": 1, "*.boostymark.com": 1, "netgate.com", "*.netgate.com",
"discord.com": 1, "*.discord.com": 1, "discord.gg": 1, "*.discord.gg": 1, "boostymark.com", "*.boostymark.com",
"notepad-plus-plus.org": 1, "*.notepad-plus-plus.org": 1, "discord.com", "*.discord.com", "discord.gg", "*.discord.gg",
"clickhouse.com": 1, "*.clickhouse.com": 1, "notepad-plus-plus.org", "*.notepad-plus-plus.org",
"hashicorp.com": 1, "*.hashicorp.com": 1, "clickhouse.com", "*.clickhouse.com",
"vagrantup.com": 1, "*.vagrantup.com": 1, "hashicorp.com", "*.hashicorp.com",
"vagrantcloud.com": 1, "*.vagrantcloud.com": 1, "vagrantup.com", "*.vagrantup.com",
"turnkeylinux.org": 1, "*.turnkeylinux.org": 1, "vagrantcloud.com", "*.vagrantcloud.com",
"habr.com": 1, "*.habr.com": 1, "turnkeylinux.org", "*.turnkeylinux.org",
"giters.com": 1, "*.giters.com": 1, "habr.com", "*.habr.com",
"imdb.com": 1, "*.imdb.com": 1, "giters.com", "*.giters.com",
"themoviedb.org": 1, "*.themoviedb.org": 1, "imdb.com", "*.imdb.com",
"intel.com": 1, "*.intel.com": 1, "themoviedb.org", "*.themoviedb.org",
"terraform.io": 1, "*.terraform.io": 1 "intel.com", "*.intel.com",
}; "terraform.io", "*.terraform.io"
];
var googleDomains = [ var googleDomains = [
"youtube.com", "*.youtube.com", "*.youtu.be", "youtu.be", "youtube.com", "*.youtube.com", "*.youtu.be", "youtu.be",
@@ -38,8 +39,18 @@ function FindProxyForURL(url, host) {
"jnn-pa.googleapis.com", "l.google.com" "jnn-pa.googleapis.com", "l.google.com"
]; ];
// Check if the host matches any proxy domain // Function to check if host matches any pattern
if (proxyDomains[host] || googleDomains.some(pattern => shExpMatch(host, pattern))) { function matchesAny(host, patterns) {
for (var i = 0; i < patterns.length; i++) {
if (shExpMatch(host, patterns[i])) {
return true;
}
}
return false;
}
// Check if the host matches any domain in the list
if (matchesAny(host, proxyDomains) || matchesAny(host, googleDomains)) {
return proxy; return proxy;
} }