Skip to content

fix: bypass proxy for embedded localhost UI#605

Open
Yashh56 wants to merge 1 commit into
cinnyapp:mainfrom
Yashh56:fix/connection
Open

fix: bypass proxy for embedded localhost UI#605
Yashh56 wants to merge 1 commit into
cinnyapp:mainfrom
Yashh56:fix/connection

Conversation

@Yashh56

@Yashh56 Yashh56 commented Jul 8, 2026

Copy link
Copy Markdown

Fixes an issue where the desktop app fails to load its UI and shows a "Message Corrupt" or "Connection to SOCKSv5 server lost" error when an http_proxy environment variable or VPN is active.

Root Cause:
Tauri's underlying webview inherits system proxy settings. When a proxy is active, the webview attempts to route the request to http://localhost:<port> (used by tauri-plugin-localhost) through the remote proxy. The proxy drops the connection because it cannot resolve the client's localhost.

Solution:
Dynamically inject localhost and 127.0.0.1 into the NO_PROXY and no_proxy environment variables at the start of the run() function in src-tauri/src/lib.rs. This instructs the webview to bypass the proxy specifically when loading local UI assets, while ensuring all actual outbound traffic (e.g., Matrix API requests) continues to route securely through the proxy.

Testing:

  • Verified the app compiles successfully.
  • Tested running the app with an active http_proxy and confirmed the UI loads normally without errors.

closes : #560 #561

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.

Interface cant load when vpn is active

1 participant