FelisCatus / SwitchyOmega

Manage and switch between multiple proxies quickly & easily.
GNU General Public License v3.0
21.31k stars 3.2k forks source link

[Feature request] Switch on referer #1690

Open berndmr opened 5 years ago

berndmr commented 5 years ago

Hello. First - good work. Really like using it.

Is it possible to add a Condition Type auto switching on referer header? I want to use switchy omega to automatically switch between using VPN or DIRECT. I have a proxy for the VPN set up.

But I am only able to get the frontpage transfered through the proxy. All items this page gets from numerouse other servers are fetched direct. It is not feasable to add all this domains to the switch. But in the referer header, they all have the frontpage as referer. So switching with this information in addition to the host based would be perfect.

celeron533 commented 5 years ago
  1. The core of SwitchyOmega is PAC, and PAC does not support such function.
  2. Assuming that PAC support the referer header, you are opening the front page, for instance, aaa.com/index.html via proxy. then go to bbb.com/products.html with referer header aaa.com, and now bbb.com also transmitted via proxy. How about later you go to bbb.com/about.html by clicking the hyperlink on page bbb.com/products.html ? The referer header is still bbb.com which means no proxy required.
berndmr commented 5 years ago
  1. From what I see in the code it uses chrome.webRequest, which can read headers, for conditons and chrome.proxy to set the proxy. Not sure where the PAC part is for but not for auto-switch.
  2. Better a hit rate of 90% than one of 10% - as it is now!

From what I see which information the chroma-api makes accesable, it should be possible to autoswitch a whole webpage (tab) instead of single URLs "somehow".