martinrotter / rssguard

Feed reader (and podcast player) which supports RSS/ATOM/JSON and many web-based feed services.
GNU General Public License v3.0
1.51k stars 122 forks source link

[FR]: Proxy setup via proxyconfig files #1051

Open uriesk opened 1 year ago

uriesk commented 1 year ago

Brief description of the feature request

Allow to use proxy configuration URLs aka .pac files. Browsers have that setting too.

They are very handy and underrated. i.e. you can specify that only .onion domains should be accessed via running Tor socks proxy. And there are blogs and news websites running on .onion domains

martinrotter commented 1 year ago

Give link to some "proxyconfig" file examples.

uriesk commented 12 months ago

sure,

function FindProxyForURL(url, host) { 
  if (dnsDomainIs(host, ".onion")) {
      return "SOCKS 127.0.0.1:9050";
  }
  return "DIRECT"; 
}

This would route all onion domains over Tor, while the rest connects directly without proxy. In Firefox, it works by setting it as autoconfig url in the proxy settings (with file:/// when it's local). In Chromium browsers via launch argument:

--proxy-pac-url='data:application/x-javascript-config;base64,'$(base64 -w0 ~/.config/proxyconfig.pac)

And here the MDN page about it: https://developer.mozilla.org/en-US/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_PAC_file

martinrotter commented 11 months ago

https://ivandemarino.me/2011/03/21/How-to-handle-Proxy-PAC-configuration-with-Qt https://github.com/richmoore/qt-examples/blob/master/pac-files/proxyautoconfig.cpp