function FindProxyForURL(url, host) { var proxy = "PROXY proxy.vm:8118"; // Domains that should go through the proxy var proxyDomains = [ "linkedin.com", "www.linkedin.com", "rutracker.org", "*.rutracker.*", "2ip.ru", "kinozal.tv", "*.kinozal.tv", "ntc.party", "instagram.com", "*.instagram.com", "*.cdninstagram.com", "chatgpt.com", "*.chatgpt.com", "openai.com", "*.openai.com", "digitalocean.com", "*.digitalocean.com", "cisco.com", "*.cisco.com", "medium.com", "*.medium.com", "homarr.dev", "*.homarr.dev", "netgate.com", "*.netgate.com", "boostymark.com", "*.boostymark.com", "discord.com", "*.discord.com", "discord.gg", "*.discord.gg", "notepad-plus-plus.org", "*.notepad-plus-plus.org", "clickhouse.com", "*.clickhouse.com", "hashicorp.com", "*.hashicorp.com", "vagrantup.com", "*.vagrantup.com", "vagrantcloud.com", "*.vagrantcloud.com", "turnkeylinux.org", "*.turnkeylinux.org", "habr.com", "*.habr.com", "giters.com", "*.giters.com", "imdb.com", "*.imdb.com", "themoviedb.org", "*.themoviedb.org", "intel.com", "*.intel.com", "terraform.io", "*.terraform.io" ]; var googleDomains = [ "youtube.com", "*.youtube.com", "*.youtu.be", "youtu.be", "*.ytimg.com", "*.ggpht.com", "*.googleusercontent.com", "*.googlevideo.com", "google.com", "*.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) { 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; } // Direct connection for specific Google services if (shExpMatch(host, "mail.google.com") || shExpMatch(host, "meet.google.com")) { return "DIRECT"; } // Default: no proxy return "DIRECT"; }