#[non_exhaustive]pub enum ProxyConfigSource {
Registry,
GroupPolicy,
WinHttpDefault,
SystemConfigurationSetup,
SystemConfigurationState,
GSettings,
Kioslaverc,
KioslavercEnv,
Portal,
Env,
ConnectivityManager,
CfNetworkSystemSettings,
}Expand description
Where a ProxyMode came from. ProxyConfig keeps all of them for explanation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Registry
The per-user WinINet settings, read through
WinHttpGetIEProxyConfigForCurrentUser, which answers for the active connection,
so a VPN or dial-up connectoid carrying its own proxy is what this reports while it
is up. When that call fails the backend falls back to the plain
HKCU\…\Internet Settings values, which are the LAN connection’s: the label is
unchanged, the store behind it is not, and the two disagree exactly when a
connectoid was in charge. This label alone does not say which of them answered.
ProxyConfig::fallbacks says it for the failures where it is a loss. When the
call reports that no Internet Explorer proxy settings exist (the documented
ERROR_FILE_NOT_FOUND), the plain values are read from the same account’s own hive.
They are the answer itself, from a store documented to hold the same settings, and
nothing is recorded, except under ProxySettingsPerUser = 0. Under that setting,
Windows answers from the per-machine Connections blob instead and these per-user
values are a store it is not reading. When it fails any other way, settings may have
existed and gone unread, so this source appears in that list: the read did not learn
the value it came for.
GroupPolicy
Group policy HKLM\Software\Policies\…\Internet Settings. Recorded but never
effective, because Windows does not read the values this
crate reads from that key: no administrative template shipped with Windows writes
ProxyServer, ProxyEnable, AutoConfigURL or ProxyOverride there
(C:\Windows\PolicyDefinitions\inetres.admx defines ProxySettingsPerUser and
nothing else under it), and WinHttpGetIEProxyConfigForCurrentUser answers the same
with those values present as with the key empty. An administrator who wrote one by
hand may have meant it, so it is reported from
sources; acting on it would route through a proxy no other
component on the machine uses.
WinHttpDefault
WinHTTP machine defaults (netsh winhttp set proxy). Recorded but never
effective: Microsoft scopes this store to service and
middle-tier processes rather than ranking it against the per-user settings, so the
crate does not rank it either. A consumer that is a service reads it from
sources.
SystemConfigurationSetup
macOS Setup:/Network/Global/Proxies (configured; loses to State:, but is the
effective mode when there is no State: scope to lose to).
SystemConfigurationState
macOS State:/Network/Global/Proxies (in effect; wins when both exist).
GSettings
GNOME org.gnome.system.proxy.
Kioslaverc
KDE kioslaverc.
KioslavercEnv
The process environment, read under the variable names a kioslaverc with
ProxyType = 4 chose: httpProxy=MY_HTTP_VAR names the variable, not the proxy.
Separate from Env because only the store is shared: the naming rule
is the file’s, so the two can be read on one machine and disagree. Merged under a
single label they would both land in sources and
ProxyConfig::source would answer with whichever came first, silently.
The precedence slot is still kioslaverc’s: a ProxyType = 4 file occupies the
position any other ProxyType would, because the rule keys off the store that was
read and not off the label it hands back.
Portal
XDG portal resolver. It answers already-resolved lookups, so a
ProxyMode::Manual from this source always carries
BypassRules with no entries and no implicit set
(ImplicitBypass::Empty): the portal applied the
bypass itself and never discloses it.
The lookup names a fixed reserved probe host and not the destination you are asking
about, because the portal resolves per destination and a snapshot has none to give
it. A host-side PAC that branches on the host name therefore answers about the probe:
a ProxyMode::Direct from this source says the portal had no proxy for the
probe, which is a weaker claim than the same value read out of a settings store.
Env
Process environment, under the *_proxy convention this crate reads directly
(ProxyEnv). A kioslaverc that names its own variables
reports KioslavercEnv instead.
ConnectivityManager
Android’s ConnectivityManager.getDefaultProxy(): the proxy of the default network,
or the global one when set, as the Java framework hands it to every app. It is what
java.net.ProxySelector.getDefault() routes by, so a bypass list is read with that
selector’s rules rather than Chromium’s.
CfNetworkSystemSettings
iOS’s CFNetworkCopySystemProxySettings(): the proxy of the active network, keyed
like macOS’s SystemConfigurationState.