Home | History | Annotate | Download | only in http

Lines Matching refs:Proxy

25 import java.net.Proxy;
35 * choice of proxy server, IP address, and TLS mode. Connections may also be
43 private Proxy lastProxy;
46 /* State for negotiating the next proxy to use. */
47 private List<Proxy> proxies = Collections.emptyList();
102 if (failedRoute.getProxy().type() != Proxy.Type.DIRECT && address.getProxySelector() != null) {
103 // Tell the proxy selector when we fail to connect on a fresh connection.
111 /** Prepares the proxy servers to try. */
112 private void resetNextProxy(HttpUrl url, Proxy proxy) {
113 if (proxy != null) {
114 // If the user specifies a proxy, try that and only that.
115 proxies = Collections.singletonList(proxy);
120 List<Proxy> selectedProxies = address.getProxySelector().select(url.uri());
123 proxies.removeAll(Collections.singleton(Proxy.NO_PROXY));
124 proxies.add(Proxy.NO_PROXY);
129 /** Returns true if there's another proxy to try. */
134 /** Returns the next proxy to try. May be PROXY.NO_PROXY but never null. */
135 private Proxy nextProxy() throws IOException {
138 + "; exhausted proxy configurations: " + proxies);
140 Proxy result = proxies.get(nextProxyIndex++);
145 /** Prepares the socket addresses to attempt for the current proxy or host. */
146 private void resetNextInetSocketAddress(Proxy proxy) throws IOException {
152 if (proxy.type() == Proxy.Type.DIRECT || proxy.type() == Proxy.Type.SOCKS) {
156 SocketAddress proxyAddress = proxy.address();
159 "Proxy.address() is not an " + "InetSocketAddress: " + proxyAddress.getClass());
171 if (proxy.type() == Proxy.Type.SOCKS) {