Java Examples for org.eclipse.jetty.http2.client.http.HttpClientTransportOverHTTP2
The following java examples will help you to understand the usage of org.eclipse.jetty.http2.client.http.HttpClientTransportOverHTTP2. These source code samples are taken from different open source projects.
Example 1
| Project: cayenne-master File: JettyHttpROPConnectorIT.java View source code |
protected static HttpClient initJettyHttp2Client() {
try {
HttpClientTransportOverHTTP2 http2 = new HttpClientTransportOverHTTP2(new HTTP2Client());
http2.setUseALPN(false);
HttpClient httpClient = new HttpClient(http2, new SslContextFactory());
httpClient.start();
return httpClient;
} catch (Exception e) {
throw new CayenneRuntimeException("Exception while starting Jetty HttpClient over HTTP/2.", e);
}
}Example 2
| Project: web-framework-master File: Http2IntegrationTest.java View source code |
@Before
public void setUp() throws Exception {
sslContextFactory.setTrustStorePath(ResourceHelpers.resourceFilePath("stores/http2_client.jts"));
sslContextFactory.setTrustStorePassword("http2_client");
sslContextFactory.start();
client = new HttpClient(new HttpClientTransportOverHTTP2(new HTTP2Client()), sslContextFactory);
client.start();
}Example 3
| Project: jetty.project-master File: AbstractTest.java View source code |
protected HttpClientTransport provideClientTransport(Transport transport) {
switch(transport) {
case HTTP:
case HTTPS:
{
return new HttpClientTransportOverHTTP(1);
}
case H2C:
case H2:
{
HTTP2Client http2Client = newHTTP2Client();
return new HttpClientTransportOverHTTP2(http2Client);
}
case FCGI:
{
return new HttpClientTransportOverFCGI(1, false, "");
}
default:
{
throw new IllegalArgumentException();
}
}
}Example 4
| Project: dropwizard-master File: Http2IntegrationTest.java View source code |
@Before
public void setUp() throws Exception {
sslContextFactory.setTrustStorePath(ResourceHelpers.resourceFilePath("stores/http2_client.jts"));
sslContextFactory.setTrustStorePassword("http2_client");
sslContextFactory.start();
client = new HttpClient(new HttpClientTransportOverHTTP2(new HTTP2Client()), sslContextFactory);
client.start();
}