code: private void resetNextProxy(HttpUrl url, Proxy proxy) {
      if (proxy != null) {
        // If the user specifies a proxy, try that and only that.
        proxies = Collections.singletonList(proxy);
      } else {
        // Try each of the ProxySelector choices until one connection succeeds.
        List<Proxy> proxiesOrNull = address.proxySelector().select(url.uri());
        proxies = proxiesOrNull != null && !proxiesOrNull.isEmpty()
            ? Util.immutableList(proxiesOrNull)
            : Util.immutableList(Proxy.NO_PROXY);
      }
      nextProxyIndex = 0;
    }
docs: Prepares the proxy servers to try.