Questions tagged [http2]

HTTP2 (or HTTP v2.0) is an alternative to, but does not obsolete, HTTP1.1.

HTTP v1.1's underlying transport has several characteristics that have a negative overall effect on application performance today. HTTP/2 addresses these issues by defining an optimized mapping of HTTP's semantics to an underlying connection. Specifically, it allows interleaving of request and response messages on the same connection and uses an efficient coding for HTTP header fields. It also allows prioritization of requests, letting more important requests complete more quickly, further improving performance.

Source: RFC 7540 @ https://datatracker.ietf.org/doc/html/rfc7540
1819 questions
28
votes
3 answers

How can I enable HTTP/2 on HAProxy?

We have recently shifted from HTTP to HTTPS. As we have already moved to HTTPS, we are thinking of moving to HTTP/2 to get performance benefits. As explained above that requests between browser and LB are secured (HTTPS) while communication between…
ssharma
  • 521
  • 1
  • 7
  • 17
28
votes
2 answers

Serving Python (Flask) REST API over HTTP2

I have a Python REST service and I want to serve it using HTTP2. My current server setup is nginx -> Gunicorn. In other words, nginx (port 443 and 80 that redirects to port 443) is running as a reverse proxy and forwards requests to Gunicorn (port…
AstrOne
  • 3,569
  • 7
  • 32
  • 54
26
votes
4 answers

java 11 HttpClient leads to endless SSL loop

I am using the new java.net.http.HttpClient with the sendAsync method. The HttpClient is inside a Singelton and is created once like so: HttpClient.newBuilder().build() so really nothing special. Those requests can be POST or GET but I don't know…
Zarathustra
  • 2,853
  • 4
  • 33
  • 62
26
votes
1 answer

How do I opt out of HTTP/2 server push when using fetch?

I am writing a basic app in Javascript that uses the new fetch API. Here is a basic example of the relevant portion of the code: function foo(url) { const options = {}; options.credentials = 'omit'; options.method = 'get'; options.headers =…
Josh
  • 17,834
  • 7
  • 50
  • 68
25
votes
1 answer

How to integrate http2 with ExpressJS using nodejs module http2?

I am creating an api with nodejs and express and I want to integrate http2 with ExpressJS This is my code: 'use strict'; const http2 = require('http2'); const fs = require('fs'); const path = require('path'); const express =…
Diesan Romero
  • 1,292
  • 4
  • 20
  • 45
25
votes
1 answer

Purpose of Pseudo/Colon Header Fields

As the title suggests, I'm looking for some information on the purpose of pseudo/colon header fields, i.e. I want to know why we have a second type of header field... Also - I know pseudo/colon header fields are used in http2 in place of the message…
Nathodius
  • 253
  • 3
  • 5
24
votes
5 answers

Support HTTP/1.1 and HTTP/2 with a JAX-RS client

I want to implement a JAX-RS client that support HTTP/1.1 and HTTP/2 for a JAX-RS client. The idea is to use HTTP/2 if the server supports ALPN with HTTP/2 and uses HTTP/1.1 if the server does not provide any information. I have read some articles…
Nicolas Henneaux
  • 11,507
  • 11
  • 57
  • 82
24
votes
2 answers

Is HTTP/2 a stateless protocol?

From my understanding, HTTP/2 comes with a stateful header compression called HPACK. Doesn't it change the stateless semantics of the HTTP protocol? Is it safe for web applications to consider HTTP/2 as a stateless protocol? Finally, will HTTP/2 be…
zeronone
  • 2,912
  • 25
  • 28
24
votes
2 answers

HTTP 2 will support server push, what does this mean?

I've read a lot of things about HTTP 2 (which is still in development), so I also heard about the server push feature, but I my head, this is not clear. Does this server push feature mean that the server will be able to send a response to the client…
Epoc
  • 7,208
  • 8
  • 62
  • 66
23
votes
1 answer

Questions about gRPC support in web browsers and how they utilize HTTP2

Upon discovering gRPC, I stumbled across this blog post Why isn’t everyone already using gRPC in their SPAs? Traditionally it’s not been possible to use gRPC from browser-based applications, because gRPC requires HTTP/2, and browsers don’t…
spencer741
  • 965
  • 1
  • 10
  • 22
23
votes
2 answers

When does a http2 TCP connection close?

I understand that http2 uses one tcp connection to serve multiple requests, for example, if I request index.html which contains a.css and a.js, these three requests will be done in one tcp connection. What happens if user clicks index2.html? does…
Sato
  • 8,192
  • 17
  • 60
  • 115
23
votes
7 answers

Java 9 HttpClient send a multipart/form-data request

Below is a form:
when will submit…
vicfan
  • 231
  • 1
  • 2
  • 5
23
votes
2 answers

What does HTTP/2 mean for a reverse proxy server?

How HTTP/2 affects the implementation of a proxy server? Especially, for example, when a client sends an HTTP/2 request to a content server that only supports HTTP/1.x, should the proxy server tranform the HTTP/2 request to HTTP/1.x request before…
lifang
  • 1,485
  • 3
  • 16
  • 23
23
votes
2 answers

HTTP/2 Support in Rack / Rails

HTTP/2 is released and supported by all major browsers. There are implementations shipping in major web servers like Apache and nginx. But for us Rubyists, the choices are currently quite limited, it seems. Once upon a time (Dec 2014), Aaron…
ivanreese
  • 2,718
  • 3
  • 30
  • 36
22
votes
2 answers

Serve S3 resources via http/2

Our web app that we are building is having a lot of its assets served via S3. When looking at them in Chrome they are being served via HTTP and not http/2. Is there a config setting in S3 or a header that we could pass that would tell S3 to attempt…
Jared
  • 5,840
  • 5
  • 49
  • 83