use of org.eclipse.jetty.http2.client.HTTP2ClientConnectionFactory in project jetty.project by eclipse.
the class HttpClientTransportOverHTTP2 method doStart.
@Override
protected void doStart() throws Exception {
if (!client.isStarted()) {
client.setExecutor(httpClient.getExecutor());
client.setScheduler(httpClient.getScheduler());
client.setByteBufferPool(httpClient.getByteBufferPool());
client.setConnectTimeout(httpClient.getConnectTimeout());
client.setIdleTimeout(httpClient.getIdleTimeout());
client.setInputBufferSize(httpClient.getResponseBufferSize());
}
addBean(client);
super.doStart();
this.connectionFactory = new HTTP2ClientConnectionFactory();
client.setClientConnectionFactory((endPoint, context) -> {
HttpDestination destination = (HttpDestination) context.get(HTTP_DESTINATION_CONTEXT_KEY);
return destination.getClientConnectionFactory().newConnection(endPoint, context);
});
}
use of org.eclipse.jetty.http2.client.HTTP2ClientConnectionFactory in project dropwizard by dropwizard.
the class Http2CIntegrationTest method setUp.
@BeforeEach
@Override
void setUp() throws Exception {
final HTTP2Client http2Client = new HTTP2Client();
// No need for ALPN
http2Client.setClientConnectionFactory(new HTTP2ClientConnectionFactory());
this.http2Client = new HttpClient(new HttpClientTransportOverHTTP2(http2Client), null);
this.http2Client.start();
this.http1Client = new HttpClient();
this.http1Client.start();
}
Aggregations