tinyproxy / tinyproxy

tinyproxy - a light-weight HTTP/HTTPS proxy daemon for POSIX operating systems
GNU General Public License v2.0
4.67k stars 645 forks source link

Basic Auth using PAC? #497

Open gingerbeardman opened 1 year ago

gingerbeardman commented 1 year ago

Tinyproxy version

Issue

rofl0r commented 1 year ago

what is a PAC

gingerbeardman commented 1 year ago

Oh, sorry!

PAC = Proxy Auto Config https://en.wikipedia.org/wiki/Proxy_auto-config

It's a file containing little bit of JavaScript that can used to route proxy requests.

Here is mine:

function FindProxyForURL(url, host) {
  if (
     dnsDomainIs(host, "hoyoyo.com") ||
     dnsDomainIs(host, "storage-yahoo.jp") ||
     dnsDomainIs(host, "yahooapis.jp") ||
     dnsDomainIs(host, "yimg.jp") ||
     dnsDomainIs(host, "yahoo.co.jp")
  ) return "PROXY 12.34.56.78:8888";

  return "DIRECT";
}

I enter my PAC script URL in Network settings (macOS, iOS, Windows) and Linux can use pacproxy

The processing is done on client side, so network requests are normal unless sent to proxy. With tiny proxy filter the only option is to allow or deny request at proxy.

rofl0r commented 1 year ago

tinyproxy doesn't support PAC, but it has upstream syntax which can select upstream proxies based on domain

gingerbeardman commented 1 year ago

I'll look into it, but it seems this implies that all my traffic will go through tinyproxy and upstream, which I guess would be undesirable for me.