Bug 1890542 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

We currently only disable prefetch to avoid doing dns if the porxy was manually configured, not when it was configured through system proxy/PAC scripts.

[netwerk/dns/DNSServiceBase.cpp#52-60](https://searchfox.org/mozilla-central/rev/c09764753ea40725eb50decad2c51edecbd33308/netwerk/dns/DNSServiceBase.cpp#52-60)
```cpp
// We should avoid doing DNS when a proxy is in use.
if (StaticPrefs::network_proxy_type() ==
        nsIProtocolProxyService::PROXYCONFIG_MANUAL &&
    mHasSocksProxy && StaticPrefs::network_proxy_socks_remote_dns()) {
  // Allow IP lookups through, but nothing else.
  if (!HostIsIPLiteral(aHostname)) {
    return true;
  }
}
```

This should probably don't use the StaticPrefs to determine whether socks_remote_dns is enabled, but look into the ProxyInfo and determine whether the `TRANSPARENT_PROXY_RESOLVES_HOST` flag is set.

[netwerk/base/nsIProxyInfo.idl#100-105](https://searchfox.org/mozilla-central/rev/c09764753ea40725eb50decad2c51edecbd33308/netwerk/base/nsIProxyInfo.idl#100-105)
```cpp
/**
 * This flag is set if the proxy is to perform name resolution itself.  If
 * this is the case, the hostname is used in some fashion, and we shouldn't
 * do any form of DNS lookup ourselves.
 */
const unsigned short TRANSPARENT_PROXY_RESOLVES_HOST = 1 << 0;
```
We currently only disable prefetch to avoid doing dns if the proxy was manually configured, not when it was configured through system proxy/PAC scripts.

[netwerk/dns/DNSServiceBase.cpp#52-60](https://searchfox.org/mozilla-central/rev/c09764753ea40725eb50decad2c51edecbd33308/netwerk/dns/DNSServiceBase.cpp#52-60)
```cpp
// We should avoid doing DNS when a proxy is in use.
if (StaticPrefs::network_proxy_type() ==
        nsIProtocolProxyService::PROXYCONFIG_MANUAL &&
    mHasSocksProxy && StaticPrefs::network_proxy_socks_remote_dns()) {
  // Allow IP lookups through, but nothing else.
  if (!HostIsIPLiteral(aHostname)) {
    return true;
  }
}
```

This should probably don't use the StaticPrefs to determine whether socks_remote_dns is enabled, but look into the ProxyInfo and determine whether the `TRANSPARENT_PROXY_RESOLVES_HOST` flag is set.

[netwerk/base/nsIProxyInfo.idl#100-105](https://searchfox.org/mozilla-central/rev/c09764753ea40725eb50decad2c51edecbd33308/netwerk/base/nsIProxyInfo.idl#100-105)
```cpp
/**
 * This flag is set if the proxy is to perform name resolution itself.  If
 * this is the case, the hostname is used in some fashion, and we shouldn't
 * do any form of DNS lookup ourselves.
 */
const unsigned short TRANSPARENT_PROXY_RESOLVES_HOST = 1 << 0;
```

Back to Bug 1890542 Comment 0