Please enable Javascript to view the contents

 ·  ☕ 1 分钟

https://pi3g.com/2019/01/17/envoy-as-http-2-front-proxy-enabling-http-2-for-envoy-aka-h2/

envoy as http 2 front proxy – enabling http 2 for envoy (aka h2)

By Maximilian Batz | 2019-01-17

Out of the box envoy is not configured to set up connections with clients connecting to it with the new HTTP/2.

HTTP/2 is optimized for the modern web, with binary headers, etc. – higher speed.

Since envoy is capable of speaking HTTP/2 to clients, it is a no-brainer to set it up.

And the setup is really easy, too. You just add one line in the common_tls_context of your listener:

alpn_protocols: [ "h2,http/1.1" ]

That’s it. (The quotes should be normal quotes, in case WordPress messes these up)

ALPN stands for Application-Layer Protocol Negotiation  – it is apparently needed for HTTP/2 to work.

By default, the http_connection_manager envoy filter will support both HTTP1 and HTTP2 in the mode AUTO.

By adding the alpn_protocols you allow this functionality to actually be used.

Ref. https://dzone.com/articles/thoughts-on-server-sent-events-http2-and-envoy-1

分享

Mark Zhu
作者
Mark Zhu
An old developer