Angular8 use http2
Asked Answered
E

3

6

I'm trying to use http2 in my angular application. So I searched and found this chrome plugin https://chrome.google.com/webstore/detail/http2-and-spdy-indicator/mpbpobfflnpcgagjijhmgnchggcjblin?hl=en . It indicates my site doesn't support http2. I did search on google and on official angular page and didn't found any documentation. How can I make my angular app to support http2? So far I'm using HttpClient. Thank you.

Encephalic answered 4/10, 2019 at 13:9 Comment(0)
C
8

Your Angular app does not need to support HTTP/2, your web browser and server need to support this. When that happens the Angular app will automatically use it as the browser will translate any HttpClient calls to HTTP/2 automatically.

Culture answered 5/10, 2019 at 16:22 Comment(1)
Thank you. I'm going to use http/1.1 only because users have to change their browser's settings.Encephalic
T
3

The other answers are true for production environments. However, Angular's ng serve, which spins up a local server to serve the application in a local environment, does not currently support HTTP2.

It seems the Angular team would like to support HTTP2 in their dev server, but they are blocked by a dependent package, Express, which does not support HTTP2 despite 7 years of suggestions and complaints from their users.

Tegular answered 9/8, 2022 at 22:4 Comment(0)
T
0

There are no browser settings that need to be set. All modern browsers support http/2 by default. The place you need to actually configure http/2 is on the backend.

Teofilateosinte answered 10/3, 2022 at 18:19 Comment(1)
This doesn’t seem to add anything new to the previous answer from a few years ago.Brocade

© 2022 - 2024 — McMap. All rights reserved.