Created
March 18, 2016 10:34
-
-
Save CodingFabian/aed1c975104ccef3ceb2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP2Client client = new HTTP2Client(); | |
SslContextFactory sslContextFactory = new SslContextFactory(true); | |
HTTP2ClientConnectionFactory h2 = new HTTP2ClientConnectionFactory(); | |
client.setClientConnectionFactory(h2); | |
client.addBean(h2); | |
client.addBean(sslContextFactory); | |
client.start(); | |
FuturePromise<Session> sessionPromise = new FuturePromise<>(); | |
client.connect(sslContextFactory, new InetSocketAddress(host, port), new ServerSessionListener.Adapter(), sessionPromise); | |
Session session = sessionPromise.get(5, TimeUnit.SECONDS); | |
HttpFields requestFields = new HttpFields(); | |
MetaData.Request metaData = new MetaData.Request("GET", new HttpURI("https://" + host + ":" + port + "/"), | |
HttpVersion.HTTP_2, requestFields); | |
HeadersFrame headersFrame = new HeadersFrame(metaData, null, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment