http2

Unable to figure out why firebase hosting is not using http 2

余生长醉 提交于 2019-12-13 15:32:47
问题 I've set up a fresh hosting project (not using any custom domain at the moment) and split up some of my js files expecting them to be served via http2 (as described in firebase blog posts it should be enabled by default?) However protocol still shows up as http/1.1. Am I missing something? Do I need to add entry in my config files to force http2? DEMO: https://asimetriq-com.firebaseapp.com/ 回答1: Works for me, see attached screenshot. It may mean that you have some transparent proxy that does

Make HTTP/2 request with PHP

北战南征 提交于 2019-12-13 13:16:02
问题 Is there a way to force PHP to make a HTTP2 connection to another server just to see if that server supports it? I've tried: $options = stream_context_create(array( 'http' => array( 'method' => 'GET', 'timeout' => 5, 'protocol_version' => 1.1 ) )); $res = file_get_contents($url, false, $options); var_dump($http_response_header); And tried: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_NOBODY, 1); curl_setopt($ch, CURLOPT

Why does apache2 module http2 not exist on Ubuntu 16.04?

老子叫甜甜 提交于 2019-12-13 12:01:10
问题 I'd like to install htt2_module. After a fresh installation of Ubuntu 14.04 following the steps listed in this link, I have tried to enable the http2_module just running sudo a2enmod http2 but I get: Module http2 does not exist! the apache version installed is:Apache/2.4.7 ,then as a workaround I tried with this link adding the following repository sudo add-apt-repository ppa:ondrej/apache2 after refreshing with sudo apt-get update, and running again the command to install/enable the http2 I

Java 9 Multithreaded HTTP request

天涯浪子 提交于 2019-12-13 09:35:22
问题 I can't figure out how to covert the following sequential code to a multi-threaded properly. I have done my best to avoid any shared resource and complete thread independence. This is the single-threaded code package com.net; import jdk.incubator.http.HttpClient; import jdk.incubator.http.HttpRequest; import jdk.incubator.http.HttpResponse; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; public class

http2 request returning bad request

人盡茶涼 提交于 2019-12-13 03:11:18
问题 I have a C program of socket which has to use http2 protocol. It is returning Bad Request - HTTP Error 400. The request is badly formed. Initially, I sent a request like the following through curl 7.64: curl -v -http2 -i https://mywebsite.xyz and i got the following output: * Expire in 0 ms for 6 (transfer 0x55cc25ec95c0) * Expire in 1 ms for 1 (transfer 0x55cc25ec95c0) * Expire in 0 ms for 1 (transfer 0x55cc25ec95c0) * Expire in 1 ms for 1 (transfer 0x55cc25ec95c0) * Expire in 0 ms for 1

Haproxy - HTTP/2 - TLS ALPN - Don't work correctly

霸气de小男生 提交于 2019-12-12 18:29:35
问题 I have a centos 7 server with OpenSSl 1.0.2j fully working. With Nginx working correcly with HTTP/2 but haproxy fail. When I try to run a curl ( is already version 7.51 ) once is enabled alpn h2 I have the following error : curl --http2 -I https://domain:port/file.htm curl: (16) Error in the HTTP2 framing layer If I disabled h2, curl work correctly but of course only connect http 1.1 : curl --http2 -I https://domain.com:port/file.htm HTTP/1.1 200 OK Server: nginx/1.11.6 Date: Fri, 18 Nov 2016

Why HTTP/2 is not supported by Android's HttpUrlConnection?

笑着哭i 提交于 2019-12-12 17:31:24
问题 I just found out that Android's recommended http client HttpUrlConnection doesn't support HTTP/2. Is there a specific reason not to use HTTP/2 on Android? 回答1: You can use OkHttp if you want to take advantage of HTTP/2: https://github.com/square/okhttp It's superior to HttpUrlConnection anyway. If you're doing anything at all complicated, like getting complex JSON responses from a web API, I'd recommend Retrofit: https://square.github.io/retrofit/ 来源: https://stackoverflow.com/questions

Browser won't upgrade to H2 altough “Upgrade” headers are sent

岁酱吖の 提交于 2019-12-12 12:15:44
问题 On my webserver I'm trying to get H2 (http2) to work. Installed Apache 2.4.20 via the "ondrej" repository. I tested on a Debian 8 and Ubuntu 14.04 server, but I keep running into the same problems. I have OpenSSL 1.0.2 and SSL vhosts running. The strange thing is that the upgrade headers (Connection: upgrade and Upgrade: h2) are sent. When I do some external server testing I get the responses that h2 is running properly with ALPN support. But the problem is the browsers I tested on (Chrome

NoClassDefFoundError while trying to use jdk.incubator.http.HttpClient in java in Eclipse Oxygen [duplicate]

丶灬走出姿态 提交于 2019-12-12 10:53:20
问题 This question already has answers here : Java 9 no class definition exception (3 answers) Closed last year . Here is the code snippet that I use: HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder(URI.create("https://www.google.com")).GET().build(); HttpResponse.BodyHandler responseBodyHandler = HttpResponse.BodyHandler.asString(); HttpResponse response = client.send(request, responseBodyHandler); System.out.println("Status code = " + response

What is the WebSockets alternative in the HTTP/2 world?

扶醉桌前 提交于 2019-12-12 09:56:15
问题 The new HTTP/2 protocol comes with some promising features. Some of them: Multiplexing - a single TCP connection can be used to make multiple HTTP/2 requests and receive multiple responses (to a single origin) HTTP/2 Server Push - sending server responses to the client without receiving requests, i.e. initiated by the server Bidirectional connection - HTTP/2 spec - Streams and Multiplexing: A "stream" is an independent, bidirectional sequence of frames exchanged between the client and server