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

[Feature] Add importing Swithy proxy list #286

Closed
zzzgit opened this issue May 25, 2023 · 5 comments
Closed

[Feature] Add importing Swithy proxy list #286

zzzgit opened this issue May 25, 2023 · 5 comments
Labels
type-new-feature Adding a new feature

Comments

@zzzgit
Copy link

zzzgit commented May 25, 2023

Hi, I am from Swithy.

I am using smartProxy now. The only problem for me is importing the Swithy proxy list. Currently, there's only importing support for Autoproxy.

@salarcode salarcode changed the title 萬事俱備,只欠導入功能 [Feature] Add importing Swithy proxy list May 28, 2023
@salarcode salarcode added the type-new-feature Adding a new feature label May 28, 2023
@jackyzy823
Copy link
Contributor

Current Status

  1. Import Rule (with AutoProxy file) doesn't work functionally. The parsed rules object couldn't be de-serialized to ProxyRule class.
  2. Subscribe rule list to SwitchOmega: it ignores "!" mark (means DIRECT) , which have the opposite effect.
  3. Some SwitchyOmega condition cause parsing error: it requires U2 (uglify ast) to compile which we are not bundled. So these conditions should be filtered out. (For example FalseCondition (Disableld) , BypassCondition etc ... )

Design:

  • We could unify some functions of the Import rule with file and Subscribe rule list .

    • Use same parser for one format , but different converter to ProxyRule or SubscriptionProxyRule
  • SwitchyOmega has 2 formats of exported file (and 1 format of backup file)

    • transitional: without "@with result" mark ,
      • we should handle "!" correctly
      • we should show a window asking user all these rulse should use which proxy ( default/active/ or others)
    • modern: with "@with result" mark ,
      • we should handle "+direct" correctly
      • we should either give up all the proxy servers and show a window asking user all these rulse should use which proxy ( default/active/ or others)
      • OR we should gather all proxy servers in the file and show a window let user define the mapping between original proxies in file to proxies (default/active/or others) in smartproxy .
      • backup files:
        • we might also support import profiles

@salarcode
Copy link
Owner

salarcode commented Feb 27, 2024

I'm working on the Import Rules window atm.
It will use the externalAppRuleParser.Switchy.parseAndCompile and externalAppRuleParser.Switchy.convertToSmartProxy provided by RuleImporterSwitchy.js I will not touch RuleImporterSwitchy.js though

With this change both Rules Subscription and Rule Import will use only one method to do the parsing and importing.
So yeah the unification is happening

BTW any backup of Switchy rules would help a lot, I don't any atm.

As for SwitchyOmega formats, I have imported the parser directly from the Switchy extension. So if that is not working as intended is a surprise to me! That is found in here: RuleImporterSwitchy.js

@salarcode
Copy link
Owner

Where I really need help is to fix the parser if there is any issues. I have very little free time and can't go through specs and the existing parser to iron out the bugs.

So if you want to work on this please hold off until I finish the work on Import Rules popup and its back-end. When that is finished I would appreciate your help fixing the parser itself.

@salarcode
Copy link
Owner

To track the further work on SwitchyOmega rules I've created #345

salarcode added a commit that referenced this issue Mar 5, 2024
…capability from Switchy to import modal. Closing #286
@salarcode
Copy link
Owner

This option is added the popup.
@jackyzy823 the backend work of the importer is sorta finished but there seems to be bugs in the switchy rules parser. Feel free to jump in the code :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-new-feature Adding a new feature
Projects
None yet
Development

No branches or pull requests

3 participants