GoogleChromeLabs / simplehttp2server

A simple HTTP/2 server for development
Other
1.74k stars 99 forks source link

README - clarify service worker + localhost info #32

Closed mike-north closed 7 years ago

mike-north commented 7 years ago

The That browser warning section of the readme states

When using Chrome you can enable the allow-insecure-localhost flag on chrome://flags which disableѕ the certificate warning for localhost. This flag is required if you want to use ServiceWorkers.

However the Chromium FAQ on service worker debugging reads

Q: I get an error message about "Only secure origins are allowed". Why?

A: Service workers are only available to "secure origins" (HTTPS sites, basically) in line with a policy to prefer secure origins for powerful new features. However http://localhost is also considered a secure origin, so if you can, developing on localhost is an easy way to avoid this error.

I think the nuance here comes from the fact that, although the spec for HTTP/2 doesn't require secure connections, it has only been implemented in modern browsers for TLS connections. Thus, I think the issue at hand is:


Why should we care? There's a common misconception that developers must trust a certificate when developing with service workers on http://localhost. The current README language is broad enough to reinforce this misconception.

googlebot commented 7 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


mike-north commented 7 years ago

I signed it!

googlebot commented 7 years ago

CLAs look good, thanks!

surma commented 7 years ago

Yup, that makes a lot of sense. Thank you very much, @mike-north!