Force HTTP/2 With Chrome or Safari

Jonas N picture Jonas N · Apr 1, 2015 · Viewed 15.1k times · Source

Is there some way to tell Chrome or Safari to use HTTP/2 on a specific URL/adress/server?

I mean by changing some setting or such, not by implementing ALPN on the server socket or whatever might be needed. I want to try HTTP/2 on a server socket without waiting till I can have ALPN negotiation to tell the browsers to use HTTP/2.


Clarification: I have HTTP/2 enabled on Chrome (aka SPDY/4 via chrome://flags). It still doesn't probe my (TLS or plaintext) socket for HTTP/2 via Upgrade. I want to force Chrome to either do this, or assume HTTP/2 right off the bat.

Also, I've read that Chrome won't support HTTP/2 over plaintext connections, even though the HTTP/2 standard allows it. But maybe there's some way around that.

Answer

rluta picture rluta · Apr 2, 2015

HTTP/2 over TLS and HTTP/2 over TCP have been defined as 2 different protocols, identified respectively by h2 and h2c.

Chrome supports h2 only at this time.

If you have a server that implements only h2c, the easiest way to connect Chrome to it is to use a reverse proxy such a nghttpx in HTTP/2 bridge mode in front of your server