0
我有(實際上,從jetty-project repo複製)的碼:碼頭HTTP/2客戶端掛起獲取URL
HTTP2Client http2Client = new HTTP2Client();
SslContextFactory sslContextFactory = new SslContextFactory();
HttpClient httpClient = new HttpClient(new HttpClientTransportOverHTTP2(http2Client), sslContextFactory);
Executor executor = new QueuedThreadPool();
httpClient.setExecutor(executor);
httpClient.start();
ContentResponse response = httpClient.GET("https://www.google.com/");
出於某種原因,它等待響應無限。它有什麼問題?我正在尋找一個http/2客戶端使用情況的工作示例來訪問某個https url。謝謝!
我選擇了相對於jdk版本('jdk 1.8.0_92' - >'alpn-boot 8.1.8.v20160420')的'alpn-boon'版本。然後將'-Xbootclasspath/p:/ Users/user /.../ alpn-boot-8.1.8.v20160420.jar'添加到vm選項。它對我來說似乎還有點棘手,但它有效。謝謝! – awfun