Skip to content

feat: add global outbound proxy settings - #424

Merged
SaladDay merged 4 commits into
mainfrom
feature/global-outbound-proxy
Aug 22, 2026
Merged

feat: add global outbound proxy settings#424
SaladDay merged 4 commits into
mainfrom
feature/global-outbound-proxy

Conversation

@SaladDay

@SaladDay SaladDay commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • add persistent global outbound proxy configuration through CLI and TUI settings
  • follow the upstream model: store one proxy URL, apply it to the shared HTTP client, and fall back to standard proxy environment variables when unset
  • support HTTP, HTTPS, SOCKS5, and SOCKS5H URLs with optional username/password authentication
  • give saved configuration precedence over environment variables and existing provider-specific proxy fallback
  • apply changes immediately in the current process and reload existing Unix daemon/foreground proxy workers through the existing runtime orchestration
  • keep credentials visible on explicit configuration surfaces while redacting logs, errors, daemon status, crash diagnostics, and Debug output

User interface

  • CLI: settings outbound-proxy show/set/clear; set "" also clears the saved value
  • TUI: Settings → Global Outbound Proxy; Enter edits, validates, and immediately commits the focused field
  • fields can be entered in any order, including credentials before the URL
  • invalid URLs remain available for correction and produce readable localized errors
  • clearing the URL returns to environment-variable fallback
  • TUI confirms when environment proxy variables are present; CLI prints a warning and proceeds without a --yes flag

Scope

This does not add proxy connectivity testing, proxy scanning, per-provider proxy settings, README documentation, keyring integration, or unrelated HTTP-client hardening.

Validation

  • full sandboxed library suite: 4,131 passed, 0 failed, 2 ignored
  • focused outbound-proxy CLI/TUI/daemon tests: 12 passed
  • global proxy service tests: 6 passed
  • HTTP client proxy tests: 9 passed
  • future-schema compatible proxy-setting read test: 1 passed
  • sandboxed CLI set/show/blank-clear smoke test passed, including password-only authentication
  • cargo build --bin cc-switch
  • cargo check --bin cc-switch
  • cargo fmt --check
  • git diff --check
  • final independent blind review reported no actionable findings

Closes #419

@SaladDay
SaladDay merged commit c2831a4 into main Aug 22, 2026
6 checks passed
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