Skip to content

new feature reverse-mode#4

Open
lerkh-di wants to merge 1 commit into
txthinking:masterfrom
lerkh-di:feature/reverse-mode
Open

new feature reverse-mode#4
lerkh-di wants to merge 1 commit into
txthinking:masterfrom
lerkh-di:feature/reverse-mode

Conversation

@lerkh-di

@lerkh-di lerkh-di commented Apr 3, 2026

Copy link
Copy Markdown

Summary

This PR keeps the existing proxy behavior as the default and adds a new reversible routing mode.

  • Added a new Routing Mode selector in options:
    • Normal mode: proxy all traffic except domains in the list (existing behavior).
    • Reverse mode: proxy only domains in the list; all other traffic goes direct.
  • Preserved backward compatibility for existing saved settings and legacy flow.
  • Implemented reverse mode using PAC script logic, with wildcard handling consistent with the legacy list behavior (domain + subdomains).
  • Fixed PAC proxy formatting for IPv6 SOCKS5 endpoints.
  • Updated extension version to 2026.4.3.

Why

Some users need inverse routing behavior: only selected websites should go through SOCKS5, while everything else should bypass proxy by default.
At the same time, existing users should not experience behavior changes unless they explicitly switch modes.

Details

  • options.html
    • Added routing mode UI with:
      • Normal mode: Proxy everything except list
      • Reverse mode: Proxy only list (with wildcard subdomains)
    • Updated helper text to clarify list semantics in both modes.
  • options.js
    • Added persisted setting: routingmode.
    • Refactored save/apply logic into helper functions.
    • Kept legacy application path (fixed_servers + bypassList) unchanged for Normal mode.
    • Added reverse application path (pac_script) for Reverse mode.
    • Ensured wildcard semantics in reverse mode are aligned with legacy behavior.
    • Added IPv6-safe PAC proxy host formatting.
  • manifest.json
    • Bumped version: 2023.6.12 -> 2026.4.3.

Test Plan

  • Load extension unpacked in Chrome (chrome://extensions).
  • Verify Normal mode keeps previous behavior:
    • Domains in list go DIRECT.
    • Other domains go through SOCKS5.
  • Verify Reverse mode:
    • Domains in list go through SOCKS5.
    • Subdomains of listed domains also go through SOCKS5.
    • Domains not in list go DIRECT.
  • Verify SOCKS5 off still switches proxy mode to system.
  • Verify settings persist after reopening options page.
  • Verify reverse mode works with IPv6 SOCKS5 endpoint (e.g. [::1]:1080).

@lerkh-di lerkh-di changed the title new future reverse-mode new feature reverse-mode Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant