http2

HTTP/2 Push JSON Payload

别说谁变了你拦得住时间么 提交于 2019-12-18 06:56:07
问题 The most use cases for http/2 server push is to pre-emptively push assets files (such as javascript and css files) to browser. I am wondering can http/2 server push be used to send dynamic payload such as JSON documents to client application? From the http2-spec, it doesn't mention anything about this. Can anyone elaborate more on this? Why or why not? 回答1: HTTP/2 is not intended as a replacement of websockets in that you make a request (e.g. a web page) and may get several resources back (e

Does the per-host connection limit is raised with HTTP/2?

偶尔善良 提交于 2019-12-17 20:05:17
问题 Browsers have a per-host limit regarding number of parallel XHR (about 6 nowadays). Does this restriction apply to multiplexed HTTP/2 connections? 回答1: Browsers impose a per-domain limit of 6-8 connections when using HTTP/1.1, depending on the browser implementation. This allows at most 6-8 concurrent requests per domain. With HTTP/2, browsers open only 1 connection per domain. However, thanks to the multiplexing feature of the HTTP/2 protocol, the number of concurrent requests per domain is

How to check if website has http/2 protocol support

拟墨画扇 提交于 2019-12-17 19:16:38
问题 There is a lot of topic about http/2 protocol, but I wonder if there is a working website with this protocol. i.e. We can decide to use http:// or https:// but how to write a http/2 request? I am aware that this protocol depends on server capability, but can not find a way to check if some website e.g. google.com has http2 support enabled. As I can see in this picture, all modern browsers support this protocol. I have not seen any link that could look like a new generation protocol. My

How do I send a HTTP/2 POST request in PHP

会有一股神秘感。 提交于 2019-12-17 16:13:20
问题 I found a similar question at Sending HTTP/2 POST request in Ruby But I want to update my server with PHP The new Apple push notification HTTP/2 based API described here: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/APNsProviderAPI.html Anyone with HTTP/2 experience help me with making a request as a client in PHP. 回答1: The CURL extension for PHP >= 5.5.24 has support for HTTP/2. (since this commit) You also need a libcurl

why Chrome browser doesn't recognize my http2 server?

十年热恋 提交于 2019-12-17 06:16:27
问题 I setup my Nginx conf as per Digital Ocean paper, and now http2 is available... But in Chrome (Version 54.0.2840.98 (64-bit)) Dev tool, it's always on HTTP 1/1 : NAME METHOD STATUS PROTOCOL shell.js?v=xx.. GET 200 http/1/1 my server is running Ubuntu 16.04 LTS which supports both ALPN & NPN , and the openssl version shipped with it is 1.0.2g I checked http2 support with this tool siteand the result is : Yeah! example.com supports HTTP/2.0. ALPN supported... Also checking with curl is OK $

How do I get the client's IP address in Node.js when using the HTTP2 module?

匆匆过客 提交于 2019-12-13 17:55:13
问题 I want to get user client's IP address. This is my code: const server = http2.createSecureServer({ key: fs.readFileSync('localhost.key'), cert: fs.readFileSync('localhost.crt') }); server.on('error', (err) => console.error(err)); server.on('stream', (stream, headers) => { console.log('Path:' + headers[':path']); console.log('User Agent:' + headers['user-agent']); console.log('Cookie:' + headers.cookie); stream.respond({ 'content-type': 'text/html', ':status': 200 }); stream.end('<h1>Hello

was resource received via http/1 or http/2

◇◆丶佛笑我妖孽 提交于 2019-12-13 17:22:07
问题 How can I distinguish whether resource was served via http/1 or http/2? The BE guys implemented it on their side. and what I can see in dev tools network tab that a lot of images (80 items) is loaded in parallel. But when I look at XHR tab they seem to be loaded by smaller portions. like wait for first 6, than go for another. And it seems that before migration to http/2 it was the same. I cant see any headers indicatin which version of protocol was used 回答1: You can view that in Chrome using

http2: PUSH_PROMISE client-side stream state

余生颓废 提交于 2019-12-13 17:09:30
问题 The http2 spec says: A receiver MUST treat the receipt of a PUSH_PROMISE on a stream that is neither "open" nor "half-closed (local)" as a connection error (Section 5.4.1) of type PROTOCOL_ERROR. However, an endpoint that has sent RST_STREAM on the associated stream MUST handle PUSH_PROMISE frames that might have been created before the RST_STREAM frame is received and processed. The spec also has this lifecycle diagram. My understanding is that in order for a client to receive a PUSH_PROMISE

Can i use HTTP/2 between origin and cloudflare servers?(Apache)

时光总嘲笑我的痴心妄想 提交于 2019-12-13 16:31:28
问题 I try to do, but when i turn to bypass my domain A record, the protocol is h2 is working. All correct in browser and apache logs. When i turn on the cloudflare on the domain, the browser is working fine(I know the CF is working on HTTP2 protocol to clients). But i see in apache logs, “GET / HTTP/1.1” 302 5067 "GET /en/ HTTP/1.1" 200 5068 "POST /en/ajax/user HTTP/1.1" 200 77 Its using http/1.1, but i dont know why :) I try to set force http2 protocol using, but no difference. Any idea ?

HTTP/2 streams vs HTTP/1.1 connections

╄→гoц情女王★ 提交于 2019-12-13 15:55:19
问题 If we disregard the overhead of new connection creation in HTTP/1.1, is there any cases where connections perform better than HTTP/2 streams? I conducted some performance tests for page load times and I noticed that HTTP/1.1(https) performs better than HTTP/2 for requests with large responses. Then when I start to increase the concurrency level, HTTP/2 starts to perform better. In other words, concurrency level which HTTP/2 starts to give better performance goes up with the size of the