feat(server,web,core): explicit proxy address setting (no env vars needed) (#233)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Yaowei ZhengandClaude Fable 5 authored and GitHub committed 2026-08-07 18:53:55 +08:00
1 parent 6e1c7cc28e
commit 0cc0bd1a1a
25 files changed
+948 -278

No files matched your search

+9 -5
View File
@@ -1,11 +1,15 @@
/**
* OS-proxy resolution for the embedded server (design § "出网与系统代理"): on the
* desktop, "system proxy" means the real operating-system setting. The shell resolves
* OS-proxy resolution for the embedded server: on the desktop, "system proxy" means
* the real operating-system setting. The shell resolves
* it through Electron's resolveProxy when forking the server and injects the result
* into the child environment as HTTP_PROXY / HTTPS_PROXY — the server's dispatcher
* (and, while the admin switch is on, agent commands) then honor it. Variables already
* present in the shell's environment are never overridden (same idiom as
* bundledShellEnv): an explicitly configured environment wins over the OS lookup.
* (while the admin app-proxy switch is on) and agent commands (while the agent-proxy
* switch is on) then honor it. Variables already present in the shell's environment are
* never overridden (same idiom as bundledShellEnv): an explicitly configured
* environment wins over the OS lookup. An admin-configured explicit proxy address
* (server_settings `proxyUrl`) in turn wins over BOTH at the server's dispatcher and in
* agent command env injection — what this module injects is only the "follow the system
* proxy" default the server falls back to.
*
* Only the entry point touches Electron, behind a dynamic import; the parsing and the
* override check stay pure so they unit-test without an Electron runtime.