Skip to content

Allow localhost proxy for consomme when localhost forwarding is enabled - #42196

Merged
Feng Wang (chemwolf6922) merged 3 commits into
masterfrom
user/chemwolf6922/allow-localhost-proxy-for-consomme-when-localhost-forwarding-is-enabled
Nov 9, 2026
Merged

Feng Wang (chemwolf6922) merged 3 commits into
masterfrom
user/chemwolf6922/allow-localhost-proxy-for-consomme-when-localhost-forwarding-is-enabled

Conversation

@chemwolf6922

@chemwolf6922 Feng Wang (chemwolf6922) commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Problem: Consomme discarded reachable Windows loopback proxies because automatic proxy filtering only allowed them in mirrored mode.

Fix: Allow 127.0.0.1 proxies when Consomme localhost forwarding is enabled, preserve original settings across networking fallback, and update the rejection reason and warning.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Add test:
NetworkTests::ConsommeTests::HttpProxyLoopback
NetworkTests::NetworkTests::HttpProxyRestoredAfterNatFallback

Also manually tested by setting up a localhost proxy on Windows and check that the proxy works correctly with consomme.

@chemwolf6922
Feng Wang (chemwolf6922) requested a review from a team as a code owner November 6, 2026 08:53
Copilot AI balanced review requested due to automatic review settings November 6, 2026 08:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Reusing the warning’s resource key preserves stale translations, causing German users to see a NAT-specific explanation when a Consomme proxy is rejected.

1 open issue
What changed in this PR

This PR updates WSL’s automatic proxy filtering to allow 127.0.0.1 proxies in Consomme mode when localhost forwarding is enabled.

Changes:

  • Pass localhost-forwarding state into proxy filtering.
  • Preserve unfiltered proxy settings for reevaluation after networking fallback.
  • Update the rejection warning and add coverage for forwarding enabled and disabled.
File Description
test/​windows/​wsl/​NetworkTests.cpp Adds Consomme loopback-proxy tests for both forwarding settings.
src/​windows/​service/​exe/​LxssUserSession.cpp Supplies actual networking and forwarding settings to the proxy tracker.
src/​windows/​service/​exe/​LxssHttpProxy.h Extends tracker interfaces and state for configuration-aware filtering.
src/​windows/​service/​exe/​LxssHttpProxy.cpp Allows supported loopback proxies and refilters preserved settings after fallback.
localization/​strings/​en-US/​Resources.resw Generalizes the unsupported-loopback-proxy warning.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 6, 2026 09:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Reusing the warning’s resource key preserves outdated NAT-specific translations, and regression coverage does not verify restoration of the original proxy and bypasses after NAT-to-Consomme fallback.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Medium severity Test proxy restoration after NAT-to-Consomme fallback

src/​windows/​service/​exe/​LxssHttpProxy.cpp:598

HttpProxyLoopback starts directly in Consomme and restarts the service between forwarding settings, so it never exercises restoration after networking fallback. Losing the retained originals would therefore leave that test passing while dropping the proxy and its bypasses during NAT-to-Consomme fallback. Please add a regression test that completes the initial query under NAT, switches the same tracker to Consomme with localhost relay enabled, and verifies that the original 127.0.0.1 proxy and bypasses are restored.

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The existing test does not cover restoring filtered proxy settings on the same tracker after a NAT-to-Consomme transition, leaving loopback proxy and bypass restoration without regression coverage.

1 open issue
1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 6, 2026 10:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues with the proxy-filtering and networking-fallback changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@chemwolf6922
Feng Wang (chemwolf6922) merged commit dcfee35 into master Nov 9, 2026
17 checks passed
@chemwolf6922
Feng Wang (chemwolf6922) deleted the user/chemwolf6922/allow-localhost-proxy-for-consomme-when-localhost-forwarding-is-enabled branch November 9, 2026 02:11
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.

3 participants