Merged branch 'jetty-10.0.x' into 'jetty-11.0.x'.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2022-10-25 09:55:45 +02:00
commit ff3b14d01b
No known key found for this signature in database
GPG Key ID: 1677D141BCF3584D
18 changed files with 83 additions and 52 deletions

View File

@ -40,7 +40,7 @@ public class ProxyServerTest extends AbstractEmbeddedTest
server.start();
URI uri = server.getURI();
client.getProxyConfiguration().getProxies().add(new HttpProxy("localhost", uri.getPort()));
client.getProxyConfiguration().addProxy(new HttpProxy("localhost", uri.getPort()));
}
@AfterEach

View File

@ -659,7 +659,7 @@ public class HTTPClientDocs
// Add the new proxy to the list of proxies already registered.
ProxyConfiguration proxyConfig = httpClient.getProxyConfiguration();
proxyConfig.getProxies().add(proxy);
proxyConfig.addProxy(proxy);
ContentResponse response = httpClient.GET("http://domain.com/path");
// end::proxy[]
@ -684,7 +684,7 @@ public class HTTPClientDocs
// Proxy configuration.
ProxyConfiguration proxyConfig = httpClient.getProxyConfiguration();
HttpProxy proxy = new HttpProxy("proxy.net", 8080);
proxyConfig.getProxies().add(proxy);
proxyConfig.addProxy(proxy);
ContentResponse response = httpClient.newRequest(serverURI).send();
// end::proxyAuthentication[]

View File

@ -54,7 +54,7 @@ public class WebSocketClientDocs
// Instantiate and configure HttpClient.
HttpClient httpClient = new HttpClient();
// For example, configure a proxy.
httpClient.getProxyConfiguration().getProxies().add(new HttpProxy("localhost", 8888));
httpClient.getProxyConfiguration().addProxy(new HttpProxy("localhost", 8888));
// Instantiate WebSocketClient, passing HttpClient to the constructor.
WebSocketClient webSocketClient = new WebSocketClient(httpClient);

View File

@ -14,13 +14,14 @@
package org.eclipse.jetty.client;
import java.net.URI;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import org.eclipse.jetty.http.HttpScheme;
import org.eclipse.jetty.io.ClientConnectionFactory;
import org.eclipse.jetty.util.BlockingArrayQueue;
import org.eclipse.jetty.util.HostPort;
import org.eclipse.jetty.util.ssl.SslContextFactory;
@ -30,23 +31,50 @@ import org.eclipse.jetty.util.ssl.SslContextFactory;
* Applications add subclasses of {@link Proxy} to this configuration via:
* <pre>
* ProxyConfiguration proxyConfig = httpClient.getProxyConfiguration();
* proxyConfig.getProxies().add(new HttpProxy(proxyHost, 8080));
* proxyConfig.addProxy(new HttpProxy(proxyHost, 8080));
* </pre>
*
* @see HttpClient#getProxyConfiguration()
*/
public class ProxyConfiguration
{
private final List<Proxy> proxies = new ArrayList<>();
private final List<Proxy> proxies = new BlockingArrayQueue<>();
/**
* @deprecated use {@link #addProxy(Proxy)} and {@link #removeProxy(Proxy)} instead
* @return the forward proxies to use
*/
@Deprecated(forRemoval = true)
public List<Proxy> getProxies()
{
return proxies;
}
/**
* Adds a proxy.
*
* @param proxy a proxy
* @throws NullPointerException if {@code proxy} is null
*/
public void addProxy(Proxy proxy)
{
proxies.add(Objects.requireNonNull(proxy));
}
/**
* Removes a proxy.
*
* @param proxy a proxy
* @return true if a match is found
*/
public boolean removeProxy(Proxy proxy)
{
return proxies.remove(proxy);
}
public Proxy match(Origin origin)
{
for (Proxy proxy : getProxies())
for (Proxy proxy : proxies)
{
if (proxy.matches(origin))
return proxy;

View File

@ -98,7 +98,7 @@ public class HttpClientCustomProxyTest
// Setup the custom proxy
int proxyPort = connector.getLocalPort();
int serverPort = proxyPort + 1; // Any port will do for these tests - just not the same as the proxy
client.getProxyConfiguration().getProxies().add(new CAFEBABEProxy(new Origin.Address("localhost", proxyPort), false));
client.getProxyConfiguration().addProxy(new CAFEBABEProxy(new Origin.Address("localhost", proxyPort), false));
ContentResponse response = client.newRequest(serverHost, serverPort)
.timeout(5, TimeUnit.SECONDS)

View File

@ -231,7 +231,7 @@ public class HttpClientProxyProtocolTest
int proxyPort = connector.getLocalPort();
int serverPort = proxyPort + 1; // Any port will do.
client.getProxyConfiguration().getProxies().add(new HttpProxy("localhost", proxyPort));
client.getProxyConfiguration().addProxy(new HttpProxy("localhost", proxyPort));
// We are simulating to be a HttpClient inside a proxy.
// The server is configured with the PROXY protocol to know the socket address of clients.

View File

@ -60,7 +60,7 @@ public class HttpClientProxyTest extends AbstractHttpClientServerTest
int proxyPort = connector.getLocalPort();
int serverPort = proxyPort + 1; // Any port will do for these tests - just not the same as the proxy
client.getProxyConfiguration().getProxies().add(new HttpProxy("localhost", proxyPort));
client.getProxyConfiguration().addProxy(new HttpProxy("localhost", proxyPort));
ContentResponse response = client.newRequest(serverHost, serverPort)
.scheme(scenario.getScheme())
@ -108,7 +108,7 @@ public class HttpClientProxyTest extends AbstractHttpClientServerTest
String proxyHost = "localhost";
int proxyPort = connector.getLocalPort();
int serverPort = proxyPort + 1; // Any port will do for these tests - just not the same as the proxy
client.getProxyConfiguration().getProxies().add(new HttpProxy(proxyHost, proxyPort));
client.getProxyConfiguration().addProxy(new HttpProxy(proxyHost, proxyPort));
ContentResponse response1 = client.newRequest(serverHost, serverPort)
.scheme(scenario.getScheme())
@ -202,7 +202,7 @@ public class HttpClientProxyTest extends AbstractHttpClientServerTest
});
int proxyPort = connector.getLocalPort();
client.getProxyConfiguration().getProxies().add(new HttpProxy(proxyHost, proxyPort));
client.getProxyConfiguration().addProxy(new HttpProxy(proxyHost, proxyPort));
ContentResponse response1 = client.newRequest(serverHost, serverPort)
.scheme(scenario.getScheme())
@ -290,7 +290,7 @@ public class HttpClientProxyTest extends AbstractHttpClientServerTest
client.getAuthenticationStore().addAuthentication(new BasicAuthentication(proxyURI, proxyRealm, "proxyUser", "proxyPassword"));
URI serverURI = URI.create(scenario.getScheme() + "://" + serverHost + ":" + serverPort);
client.getAuthenticationStore().addAuthentication(new BasicAuthentication(serverURI, serverRealm, "serverUser", "serverPassword"));
client.getProxyConfiguration().getProxies().add(new HttpProxy(proxyHost, proxyPort));
client.getProxyConfiguration().addProxy(new HttpProxy(proxyHost, proxyPort));
final AtomicInteger requests = new AtomicInteger();
client.getRequestListeners().add(new Request.Listener.Adapter()
{
@ -361,7 +361,7 @@ public class HttpClientProxyTest extends AbstractHttpClientServerTest
int serverPort = proxyPort + 1;
URI proxyURI = URI.create(scenario.getScheme() + "://" + proxyHost + ":" + proxyPort);
client.getAuthenticationStore().addAuthentication(new BasicAuthentication(proxyURI, proxyRealm, "proxyUser", "proxyPassword"));
client.getProxyConfiguration().getProxies().add(new HttpProxy(proxyHost, proxyPort));
client.getProxyConfiguration().addProxy(new HttpProxy(proxyHost, proxyPort));
final AtomicInteger requests = new AtomicInteger();
client.getRequestListeners().add(new Request.Listener.Adapter()
{

View File

@ -77,7 +77,7 @@ public class Socks4ProxyTest
public void testSocks4Proxy() throws Exception
{
int proxyPort = proxy.socket().getLocalPort();
client.getProxyConfiguration().getProxies().add(new Socks4Proxy("localhost", proxyPort));
client.getProxyConfiguration().addProxy(new Socks4Proxy("localhost", proxyPort));
CountDownLatch latch = new CountDownLatch(1);
@ -139,7 +139,7 @@ public class Socks4ProxyTest
public void testSocks4ProxyWithSplitResponse() throws Exception
{
int proxyPort = proxy.socket().getLocalPort();
client.getProxyConfiguration().getProxies().add(new Socks4Proxy("localhost", proxyPort));
client.getProxyConfiguration().addProxy(new Socks4Proxy("localhost", proxyPort));
CountDownLatch latch = new CountDownLatch(1);
@ -215,7 +215,7 @@ public class Socks4ProxyTest
// The hostname must be that of the server, not of the proxy.
ssl.setHostnameVerifier((hostname, session) -> serverHost.equals(hostname));
});
client.getProxyConfiguration().getProxies().add(new Socks4Proxy(proxyHost, proxyPort));
client.getProxyConfiguration().addProxy(new Socks4Proxy(proxyHost, proxyPort));
CountDownLatch latch = new CountDownLatch(1);
client.newRequest(serverHost, serverPort)
@ -283,7 +283,7 @@ public class Socks4ProxyTest
{
String proxyHost = "localhost";
int proxyPort = proxy.socket().getLocalPort();
client.getProxyConfiguration().getProxies().add(new Socks4Proxy(proxyHost, proxyPort));
client.getProxyConfiguration().addProxy(new Socks4Proxy(proxyHost, proxyPort));
long timeout = 1000;
Request request = client.newRequest("localhost", proxyPort + 1)
@ -305,7 +305,7 @@ public class Socks4ProxyTest
{
String proxyHost = "localhost";
int proxyPort = proxy.socket().getLocalPort();
client.getProxyConfiguration().getProxies().add(new Socks4Proxy(proxyHost, proxyPort));
client.getProxyConfiguration().addProxy(new Socks4Proxy(proxyHost, proxyPort));
long idleTimeout = 1000;
client.setIdleTimeout(idleTimeout);
@ -327,7 +327,7 @@ public class Socks4ProxyTest
{
String proxyHost = "localhost";
int proxyPort = proxy.socket().getLocalPort();
client.getProxyConfiguration().getProxies().add(new Socks4Proxy(proxyHost, proxyPort));
client.getProxyConfiguration().addProxy(new Socks4Proxy(proxyHost, proxyPort));
Request request = client.newRequest("localhost", proxyPort + 1);
FutureResponseListener listener = new FutureResponseListener(request);

View File

@ -345,7 +345,7 @@ public class HttpClientTransportOverHTTP2Test extends AbstractTest
});
int proxyPort = connector.getLocalPort();
client.getProxyConfiguration().getProxies().add(new HttpProxy(new Origin.Address("localhost", proxyPort), false, new Origin.Protocol(List.of("h2c"), false)));
client.getProxyConfiguration().addProxy(new HttpProxy(new Origin.Address("localhost", proxyPort), false, new Origin.Protocol(List.of("h2c"), false)));
int serverPort = proxyPort + 1; // Any port will do, just not the same as the proxy.
ContentResponse response = client.newRequest("localhost", serverPort)

View File

@ -152,7 +152,7 @@ public class AsyncMiddleManServletTest
clientPool.setName("client");
client = new HttpClient();
client.setExecutor(clientPool);
client.getProxyConfiguration().getProxies().add(new HttpProxy("localhost", proxyConnector.getLocalPort()));
client.getProxyConfiguration().addProxy(new HttpProxy("localhost", proxyConnector.getLocalPort()));
client.start();
}

View File

@ -204,7 +204,7 @@ public class ForwardProxyServerTest
ClientConnector clientConnector = new ClientConnector();
clientConnector.setSslContextFactory(clientTLS);
HttpClient httpClient = new HttpClient(new HttpClientTransportOverHTTP(clientConnector));
httpClient.getProxyConfiguration().getProxies().add(newHttpProxy());
httpClient.getProxyConfiguration().addProxy(newHttpProxy());
httpClient.start();
try
@ -253,7 +253,7 @@ public class ForwardProxyServerTest
});
HttpClient httpClient = new HttpClient();
httpClient.getProxyConfiguration().getProxies().add(newHttpProxy());
httpClient.getProxyConfiguration().addProxy(newHttpProxy());
httpClient.start();
ContentResponse response = httpClient.newRequest("[::1]", serverConnector.getLocalPort())
@ -292,7 +292,7 @@ public class ForwardProxyServerTest
});
HttpClient httpClient = new HttpClient();
httpClient.getProxyConfiguration().getProxies().add(newHttpProxy());
httpClient.getProxyConfiguration().addProxy(newHttpProxy());
httpClient.start();
ContentResponse response = httpClient.newRequest("[::1]", serverConnector.getLocalPort())

View File

@ -197,7 +197,7 @@ public class ForwardProxyTLSServerTest
startProxy(proxyTLS);
HttpClient httpClient = newHttpClient();
httpClient.getProxyConfiguration().getProxies().add(newHttpProxy());
httpClient.getProxyConfiguration().addProxy(newHttpProxy());
httpClient.start();
try
@ -232,7 +232,7 @@ public class ForwardProxyTLSServerTest
startProxy(proxyTLS);
HttpClient httpClient = newHttpClient();
httpClient.getProxyConfiguration().getProxies().add(newHttpProxy());
httpClient.getProxyConfiguration().addProxy(newHttpProxy());
httpClient.start();
try
@ -279,7 +279,7 @@ public class ForwardProxyTLSServerTest
startProxy(proxyTLS);
HttpClient httpClient = newHttpClient();
httpClient.getProxyConfiguration().getProxies().add(newHttpProxy());
httpClient.getProxyConfiguration().addProxy(newHttpProxy());
httpClient.start();
try
@ -364,7 +364,7 @@ public class ForwardProxyTLSServerTest
});
HttpClient httpClient = newHttpClient();
httpClient.getProxyConfiguration().getProxies().add(newHttpProxy());
httpClient.getProxyConfiguration().addProxy(newHttpProxy());
// Short idle timeout for HttpClient.
httpClient.setIdleTimeout(idleTimeout);
httpClient.start();
@ -402,7 +402,7 @@ public class ForwardProxyTLSServerTest
stopProxy();
HttpClient httpClient = newHttpClient();
httpClient.getProxyConfiguration().getProxies().add(new HttpProxy(new Origin.Address("localhost", proxyPort), proxySslContextFactory != null));
httpClient.getProxyConfiguration().addProxy(new HttpProxy(new Origin.Address("localhost", proxyPort), proxySslContextFactory != null));
httpClient.start();
ExecutionException x = assertThrows(ExecutionException.class, () ->
@ -430,7 +430,7 @@ public class ForwardProxyTLSServerTest
startProxy(proxyTLS);
HttpClient httpClient = newHttpClient();
httpClient.getProxyConfiguration().getProxies().add(newHttpProxy());
httpClient.getProxyConfiguration().addProxy(newHttpProxy());
httpClient.start();
assertThrows(ExecutionException.class, () ->
@ -462,7 +462,7 @@ public class ForwardProxyTLSServerTest
});
HttpClient httpClient = newHttpClient();
httpClient.getProxyConfiguration().getProxies().add(newHttpProxy());
httpClient.getProxyConfiguration().addProxy(newHttpProxy());
httpClient.start();
assertThrows(ExecutionException.class, () ->
@ -485,7 +485,7 @@ public class ForwardProxyTLSServerTest
HttpClient httpClient = newHttpClient();
HttpProxy httpProxy = new HttpProxy(new Origin.Address("[::1]", proxyConnector.getLocalPort()), proxyTLS != null);
httpClient.getProxyConfiguration().getProxies().add(httpProxy);
httpClient.getProxyConfiguration().addProxy(httpProxy);
httpClient.start();
try
@ -614,7 +614,7 @@ public class ForwardProxyTLSServerTest
HttpProxy httpProxy = newHttpProxy();
if (includeAddress)
httpProxy.getIncludedAddresses().add("localhost:" + serverConnector.getLocalPort());
httpClient.getProxyConfiguration().getProxies().add(httpProxy);
httpClient.getProxyConfiguration().addProxy(httpProxy);
URI uri = URI.create((proxySslContextFactory == null ? "http" : "https") + "://localhost:" + proxyConnector.getLocalPort());
httpClient.getAuthenticationStore().addAuthentication(new BasicAuthentication(uri, realm, "proxyUser", "proxyPassword"));
httpClient.start();
@ -696,7 +696,7 @@ public class ForwardProxyTLSServerTest
clientConnector.setSelectors(1);
clientConnector.setSslContextFactory(clientSslContextFactory);
HttpClient httpClient = new HttpClient(new HttpClientTransportOverHTTP(clientConnector));
httpClient.getProxyConfiguration().getProxies().add(newHttpProxy());
httpClient.getProxyConfiguration().addProxy(newHttpProxy());
httpClient.start();
try
@ -767,7 +767,7 @@ public class ForwardProxyTLSServerTest
proxyClientTLS.setEndpointIdentificationAlgorithm(null);
proxyClientTLS.start();
HttpProxy httpProxy = new HttpProxy(new Origin.Address("localhost", proxyConnector.getLocalPort()), proxyClientTLS);
httpClient.getProxyConfiguration().getProxies().add(httpProxy);
httpClient.getProxyConfiguration().addProxy(httpProxy);
httpClient.start();
try
@ -798,7 +798,7 @@ public class ForwardProxyTLSServerTest
startProxy(proxyTLS);
HttpClient httpClient = newHttpClient();
httpClient.getProxyConfiguration().getProxies().add(newHttpProxy());
httpClient.getProxyConfiguration().addProxy(newHttpProxy());
httpClient.start();
try
@ -847,7 +847,7 @@ public class ForwardProxyTLSServerTest
});
startProxy(proxyTLS);
HttpClient httpClient = newHttpClient();
httpClient.getProxyConfiguration().getProxies().add(newHttpProxy());
httpClient.getProxyConfiguration().addProxy(newHttpProxy());
httpClient.setConnectTimeout(timeout);
httpClient.setIdleTimeout(4 * timeout);
httpClient.start();
@ -883,7 +883,7 @@ public class ForwardProxyTLSServerTest
});
startProxy(proxyTLS);
HttpClient httpClient = newHttpClient();
httpClient.getProxyConfiguration().getProxies().add(newHttpProxy());
httpClient.getProxyConfiguration().addProxy(newHttpProxy());
httpClient.setConnectTimeout(timeout);
// Short idle timeout for HttpClient.
httpClient.setIdleTimeout(timeout);
@ -929,7 +929,7 @@ public class ForwardProxyTLSServerTest
}
});
HttpClient httpClient = newHttpClient();
httpClient.getProxyConfiguration().getProxies().add(newHttpProxy());
httpClient.getProxyConfiguration().addProxy(newHttpProxy());
httpClient.setConnectTimeout(timeout);
httpClient.setIdleTimeout(10 * timeout);
httpClient.start();
@ -978,7 +978,7 @@ public class ForwardProxyTLSServerTest
}
HttpClient httpClient = newHttpClient();
httpClient.getProxyConfiguration().getProxies().add(new HttpProxy(proxyHost, proxyPort));
httpClient.getProxyConfiguration().addProxy(new HttpProxy(proxyHost, proxyPort));
httpClient.start();
try

View File

@ -117,7 +117,7 @@ public class ProxyServletFailureTest
QueuedThreadPool executor = new QueuedThreadPool();
executor.setName("client");
result.setExecutor(executor);
result.getProxyConfiguration().getProxies().add(new HttpProxy("localhost", proxyConnector.getLocalPort()));
result.getProxyConfiguration().addProxy(new HttpProxy("localhost", proxyConnector.getLocalPort()));
result.start();
return result;
}

View File

@ -109,7 +109,7 @@ public class ProxyServletLoadTest
clientPool.setName("client");
HttpClient result = new HttpClient();
result.setExecutor(clientPool);
result.getProxyConfiguration().getProxies().add(new HttpProxy("localhost", proxyConnector.getLocalPort()));
result.getProxyConfiguration().addProxy(new HttpProxy("localhost", proxyConnector.getLocalPort()));
result.start();
client = result;
}

View File

@ -62,6 +62,7 @@ import org.eclipse.jetty.client.ConnectionPool;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.client.HttpDestination;
import org.eclipse.jetty.client.HttpProxy;
import org.eclipse.jetty.client.ProxyConfiguration.Proxy;
import org.eclipse.jetty.client.api.ContentResponse;
import org.eclipse.jetty.client.api.Request;
import org.eclipse.jetty.client.api.Response;
@ -122,6 +123,7 @@ public class ProxyServletTest
}
private HttpClient client;
private Proxy clientProxy;
private Server proxy;
private ServerConnector proxyConnector;
private ServletContextHandler proxyContext;
@ -196,6 +198,7 @@ public class ProxyServletTest
private void startClient(Consumer<HttpClient> consumer) throws Exception
{
clientProxy = new HttpProxy("localhost", proxyConnector.getLocalPort());
client = prepareClient(consumer);
}
@ -205,7 +208,7 @@ public class ProxyServletTest
clientPool.setName("client");
HttpClient result = new HttpClient();
result.setExecutor(clientPool);
result.getProxyConfiguration().getProxies().add(new HttpProxy("localhost", proxyConnector.getLocalPort()));
result.getProxyConfiguration().addProxy(clientProxy);
if (consumer != null)
consumer.accept(result);
result.start();
@ -728,7 +731,7 @@ public class ProxyServletTest
startProxy(proxyServletClass);
startClient();
int port = serverConnector.getLocalPort();
client.getProxyConfiguration().getProxies().get(0).getExcludedAddresses().add("127.0.0.1:" + port);
clientProxy.getExcludedAddresses().add("127.0.0.1:" + port);
// Try with a proxied host
ContentResponse response = client.newRequest("localhost", port)

View File

@ -175,7 +175,7 @@ public class UnixDomainTest
ClientConnector clientConnector = ClientConnector.forUnixDomain(unixDomainPath);
HttpClient httpClient = new HttpClient(new HttpClientTransportDynamic(clientConnector));
httpClient.getProxyConfiguration().getProxies().add(new HttpProxy("localhost", fakeProxyPort));
httpClient.getProxyConfiguration().addProxy(new HttpProxy("localhost", fakeProxyPort));
httpClient.start();
try
{

View File

@ -586,7 +586,7 @@ public class HttpClientTransportDynamicTest
int proxyPort = connector.getLocalPort();
// The proxy speaks both http/1.1 and h2c.
Origin.Protocol proxyProtocol = new Origin.Protocol(List.of("http/1.1", "h2c"), false);
client.getProxyConfiguration().getProxies().add(new HttpProxy(new Origin.Address("localhost", proxyPort), false, proxyProtocol));
client.getProxyConfiguration().addProxy(new HttpProxy(new Origin.Address("localhost", proxyPort), false, proxyProtocol));
// Make an upgrade request from HTTP/1.1 to H2C.
int serverPort = proxyPort + 1; // Any port will do.

View File

@ -260,7 +260,7 @@ public class ProxyWithDynamicTransportTest
int proxyPort = proxySecure ? proxyTLSConnector.getLocalPort() : proxyConnector.getLocalPort();
Origin.Address proxyAddress = new Origin.Address("localhost", proxyPort);
HttpProxy proxy = new HttpProxy(proxyAddress, proxySecure, proxyProtocol);
client.getProxyConfiguration().getProxies().add(proxy);
client.getProxyConfiguration().addProxy(proxy);
String scheme = serverSecure ? "https" : "http";
int serverPort = serverSecure ? serverTLSConnector.getLocalPort() : serverConnector.getLocalPort();
@ -296,7 +296,7 @@ public class ProxyWithDynamicTransportTest
int proxyPort = proxyConnector.getLocalPort();
Origin.Address proxyAddress = new Origin.Address("localhost", proxyPort);
HttpProxy proxy = new HttpProxy(proxyAddress, false, new Origin.Protocol(List.of("h2c"), false));
client.getProxyConfiguration().getProxies().add(proxy);
client.getProxyConfiguration().addProxy(proxy);
long idleTimeout = 1000;
http2Client.setStreamIdleTimeout(idleTimeout);
@ -337,7 +337,7 @@ public class ProxyWithDynamicTransportTest
int proxyPort = proxyConnector.getLocalPort();
Origin.Address proxyAddress = new Origin.Address("localhost", proxyPort);
HttpProxy httpProxy = new HttpProxy(proxyAddress, false, new Origin.Protocol(List.of("h2c"), false));
client.getProxyConfiguration().getProxies().add(httpProxy);
client.getProxyConfiguration().addProxy(httpProxy);
proxy.stop();
CountDownLatch latch = new CountDownLatch(1);
@ -372,7 +372,7 @@ public class ProxyWithDynamicTransportTest
int proxyPort = proxyConnector.getLocalPort();
Origin.Address proxyAddress = new Origin.Address("localhost", proxyPort);
HttpProxy httpProxy = new HttpProxy(proxyAddress, false, new Origin.Protocol(List.of("h2c"), false));
client.getProxyConfiguration().getProxies().add(httpProxy);
client.getProxyConfiguration().addProxy(httpProxy);
CountDownLatch latch = new CountDownLatch(1);
client.newRequest("localhost", serverConnector.getLocalPort())