Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📐 PAC: add options for direct and proxied groups #2990

Merged
merged 2 commits into from
Oct 16, 2020
Merged

Conversation

database64128
Copy link
Contributor

@database64128 database64128 commented Oct 14, 2020

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly

  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])

  • Use Preview tab to see how your pull request will actually look like

  • Searched for similar pull requests

  • Compiled the code with Visual Studio

  • Require translation update

  • Require document update (readme.md, wikipage, etc)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New feature

Description of your pull request and other information

Notes

  • The PAC mode now defaults to whitelist mode.
  • geositeDirectGroups is initialized with cn and geolocation-!cn@cn.
  • geositeProxiedGroups is initialized with geolocation-!cn.
  • When geositePreferDirect is false (default), PAC works in whitelist mode. Exception rules are generated from geositeDirectGroups. Unmatched domains goes through the proxy.
  • When geositePreferDirect is true, PAC works in blacklist mode. Blocking rules are generated from geositeProxiedGroups. Exception rules are generated from geositeDirectGroups. Unmatched domains are connected to directly.
  • The new default values make sure that:
    • When in whitelist mode, Chinese domains, including non-Chinese companies' Chinese CDNs, are connected to directly.
    • When in blacklist mode, only non-Chinese domains goes through the proxy. Chinese domains, as well as non-Chinese companies' Chinese CDNs, are connected to directly.

- Configuration: geositeDirectGroups + geositeProxiedGroups + geositePreferDirect
- PAC: rule generation using these new groups + cleanup
@database64128 database64128 added this to the v4.2.x milestone Oct 14, 2020
@database64128 database64128 requested review from chenshaoju, celeron533, a user and Stzx October 14, 2020 13:39
@chenshaoju
Copy link
Collaborator

Base Shadowsocks-4.2.0.61-Release.exe, the generated pac.txt is whitelist correctly.

After change geositePreferDirect to true, The generated pac.txt is blacklist correctly.

But there is an issue: after quit Shadowsocks, changing the geositePreferDirect and select update local pac from Geosite, The pac.txt will not update, still old version, and no any information popup from the taskbar tray area.

@database64128
Copy link
Contributor Author

But there is an issue: after quit Shadowsocks, changing the geositePreferDirect and select update local pac from Geosite, The pac.txt will not update, still old version, and no any information popup from the taskbar tray area.

The current behavior is to perform an update of pac.txt only when the upstream geosite database updates or it's the first run of a new version. So you're supposed to manually delete pac.txt to force a regeneration.

We are targeting v5 for the UI, which will fully support these features. For now, advanced users just have to put up with a few more clicks. 😅

@chenshaoju
Copy link
Collaborator

This may case user confused...

At least have a message bubble popup.

Looks need more work here. 😅

Copy link
Collaborator

@chenshaoju chenshaoju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me, but someone else must approve.

@JohnQuick
Copy link

The new default values make sure that:
When in whitelist mode, Chinese domains, including non-Chinese companies' Chinese CDNs, are connected to directly.
When in blacklist mode, only non-Chinese domains goes through the proxy. Chinese domains, as well as non-Chinese companies' Chinese CDNs, are connected to directly.

What's the difference of those two mode? Both modes state that "Chinese domains, as well as non-Chinese companies' Chinese CDNs, are connected to directly."
And there's no definition of "Chinese domains" and "non-Chinese domains".
And why are you determining whether it's a Chinese domain or not? Users only care whether this domain is accessible directly or not, no matter which category it's in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants