pub struct AndroidPacResolver { /* private fields */ }pac-android-native and crate feature pac only.Expand description
Resolves the Pac configuration ConnectivityManager reports by
asking ProxySelector.getDefault().select(uri).
The selector answers from the system settings as they are at the call, not from the
ProxyConfig passed in, so only a Pac mode that came from
ConnectivityManager is resolved, and only
while the system still names the same PAC URL. The framework is reached the way reading the
settings reaches it: through the JavaVM and Context the host gave android::init,
or else the ones it registered with ndk-context.
PacPolicy does not apply: the system service runs the script
with real DNS.
The selector answers DIRECT when the PAC service is unreachable or fails, and when the
script answers only with entries it cannot parse (it takes DIRECT, PROXY and SOCKS,
not HTTPS or SOCKS5), so a Direct from this resolver can stand
for any of those.
Implementations§
Source§impl AndroidPacResolver
impl AndroidPacResolver
Sourcepub fn resolve_config(
&self,
config: &ProxyConfig,
url: &Url,
) -> Result<Vec<ProxyStep>, Error>
pub fn resolve_config( &self, config: &ProxyConfig, url: &Url, ) -> Result<Vec<ProxyStep>, Error>
Like resolve_with_pac, with the system PAC service
evaluating the script. A URL with no host is Direct in every PAC mode.
Blocks on the framework’s call into the PAC service.
§Errors
Error::Io when the framework cannot be reached, the system settings no longer
name the PAC URL config holds, or the process’s default ProxySelector is not the
system’s PAC selector (it is installed a moment after a switch to PAC, and an app
can replace it), Error::PacInvalidResult for an answer with no element a client
could use (an unusable element beside a usable one is skipped), and
resolve’s errors for every other mode.