[GH-ISSUE #482] Auto Restore Proxy when closing Proxyman #479

Open
opened 2026-03-03 19:50:51 +03:00 by kerem · 1 comment
Owner

Originally created by @NghiaTranUIT on GitHub (Mar 29, 2025).
Original GitHub issue: https://github.com/ProxymanApp/proxyman-windows-linux/issues/482

Originally assigned to: @kics223w1 on GitHub.

Description

Like Proxyman macOS, when closing Proxyman Windows, the app doesn't restore to previous User's Proxy Setting that causes a lot of trouble. We should bring this feature to Windows.

Acceptance Criteria

  • Add this Option to setting: Advance Tab (Add to the Top of the list and have a Horizontal Seperator)
Image
  • This option is stored in AppConfiguration
  • This feature only works with Windows. For Linux, disable it and the entire Logic. Use if os(...) to check.

How it works

  1. When the app is starting, before overriding the System Proxy to Proxyman 127.0.0.1:9090, If this feature is enabled -> Proxyman will fetch:
1. The Status of the System Proxy
2. Proxy IP
3. Port
4. Bypass Proxy List
5. Do not use proxy server for local checkbox

Image

  • Ask Cursor Thinking Mode to write logic to fetch 5 data and store it in the UserProxySetting class. Beware that these settings could be undefined or empty. ALWAYS fetch this data even though this feature is OFF
  • Verify this logic can run without asking for any username/password system alert! -> It's really annoying if it asks for a username/password when launching the app
  • Save this setting to AppConfiguration
  • Override System Proxy as normal (Verify it doesn't break the current logic)
  1. When the app is closed. Before reverting the Proxy:
  • Check if this feature is ON, and there is UserProxySetting in AppConfiguration -> Write a logic to override the system proxy to UserProxySetting
  • Verify 5 properties are updated correctly after the app is closed!
  • Make sure the normal revert Proxy is still working

Edge Case 1:

  • If the Proxy Address and Port (in UserProxySetting) is the same with Proxyman (IP = 127.0.0.1 and 9090 (current port) ) and Proxy Server Toggle is ON -> We must revert as normal -> It means the Proxy Server Toggle is OFF.
  • To explain: Sometimes when Proxyman is running -> System Proxy is overrideen to Proxyman -> Proxyman is crashed -> System Proxy wasn't revert -> Can't access to the Internet -> User will try open Proxyman again -> Then close the app -> Proxyman must revert the proxy, so users can access the Internet

Real Windows 11

  • Test with real Windows 11 PC and record video
Originally created by @NghiaTranUIT on GitHub (Mar 29, 2025). Original GitHub issue: https://github.com/ProxymanApp/proxyman-windows-linux/issues/482 Originally assigned to: @kics223w1 on GitHub. ## Description Like Proxyman macOS, when closing Proxyman Windows, the app doesn't restore to previous User's Proxy Setting that causes a lot of trouble. We should bring this feature to Windows. ## Acceptance Criteria - [x] Add this Option to setting: Advance Tab (Add to the Top of the list and have a Horizontal Seperator) <img width="458" alt="Image" src="https://github.com/user-attachments/assets/837d7434-ff55-4ecf-8bd1-85fa4b62fe61" /> - [x] This option is stored in AppConfiguration - [x] This feature only works with Windows. For Linux, disable it and the entire Logic. Use if os(...) to check. ## How it works 1. When the app is starting, before overriding the System Proxy to Proxyman 127.0.0.1:9090, If this feature is enabled -> Proxyman will fetch: ``` 1. The Status of the System Proxy 2. Proxy IP 3. Port 4. Bypass Proxy List 5. Do not use proxy server for local checkbox ``` ![Image](https://github.com/user-attachments/assets/3fbd44b9-2256-4c55-87d0-9f1de17587fa) - [x] Ask `Cursor Thinking Mode` to write logic to fetch 5 data and store it in the `UserProxySetting` class. Beware that these settings could be undefined or empty. ALWAYS fetch this data even though this feature is OFF ✅ - [x] Verify this logic can run without asking for any username/password system alert! -> It's really annoying if it asks for a username/password when launching the app - [x] Save this setting to AppConfiguration - [x] Override System Proxy as normal (Verify it doesn't break the current logic) 2. When the app is closed. Before reverting the Proxy: - [x] Check if this feature is ON, and there is UserProxySetting in AppConfiguration -> Write a logic to override the system proxy to UserProxySetting - [x] Verify 5 properties are updated correctly after the app is closed! - [x] Make sure the normal revert Proxy is still working ### Edge Case 1: - [x] If the Proxy Address and Port (in UserProxySetting) is the same with Proxyman (IP = 127.0.0.1 and 9090 (current port) ) and Proxy Server Toggle is ON -> We must revert as normal -> It means the Proxy Server Toggle is OFF. - To explain: Sometimes when Proxyman is running -> System Proxy is overrideen to Proxyman -> Proxyman is crashed -> System Proxy wasn't revert -> Can't access to the Internet -> User will try open Proxyman again -> Then close the app -> Proxyman must revert the proxy, so users can access the Internet ### Real Windows 11 - [x] Test with real Windows 11 PC and record video
Author
Owner

@NghiaTranUIT commented on GitHub (Mar 29, 2025):

How to test

Scenario 1: Restore correctly

  1. In Windows -> Open Proxy Settings -> Manual Proxy -> Edit -> Try to set 5 properties with different values (The Proxy Server Toggle must be switched ON), like the below screenshot

Image

  1. Open Proxyman -> Go to Setting -> Advanced Tab -> Turn ON this feature
  2. Open System Proxy Settings -> Verify it's overridden to Proxyman 127.0.0.1:9090
  3. Close Proxyman -> Open System Proxy again -> Verify it's restored to the original settings (check 5 properties)

Scenario 2: Edge case

  • Verify it works with Edge case
<!-- gh-comment-id:2763043000 --> @NghiaTranUIT commented on GitHub (Mar 29, 2025): ### How to test #### Scenario 1: Restore correctly 1. In Windows -> Open Proxy Settings -> Manual Proxy -> Edit -> Try to set 5 properties with different values (The Proxy Server Toggle must be switched ON), like the below screenshot ![Image](https://github.com/user-attachments/assets/41a0b569-6bc6-4a2a-9901-ccdbdb446643) 2. Open Proxyman -> Go to Setting -> Advanced Tab -> Turn ON this feature 3. Open System Proxy Settings -> Verify it's overridden to Proxyman 127.0.0.1:9090 4. Close Proxyman -> Open System Proxy again -> Verify it's restored to the original settings (check 5 properties) #### Scenario 2: Edge case - [x] Verify it works with Edge case
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxyman-windows-linux#479
No description provided.