From 0431d24d114bcc722a2f71b339554c05fa81680c Mon Sep 17 00:00:00 2001 From: Anton Z Date: Fri, 31 Jan 2025 16:20:37 +0300 Subject: [PATCH] docker --- proxy.pac | 139 +++++++++++++++++++++++++++++------------------------- 1 file changed, 75 insertions(+), 64 deletions(-) diff --git a/proxy.pac b/proxy.pac index cee4677..fbcb2c1 100644 --- a/proxy.pac +++ b/proxy.pac @@ -1,65 +1,76 @@ 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"; - } - \ No newline at end of file + 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", + "docker.com", "*.docker.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" + ]; + + // 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++) { + if (shExpMatch(host, patterns[i])) { + return true; + } + } + return false; + } + + // 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; + } + + // Default: no proxy + return "DIRECT"; +}