simple-http2-server
serves the current directory on an HTTP/2.0 capable server. This server is for development purposes only. simple-http2-server
serves an index.html file while pushing some css & js assets required by the client.
simple-http2-server
is go get
-able:
$ go get github.com/DesmondANIMUS/simple-http2-server
Run the https
command from the directory you want to serve and go to https://localhost:8888
When you navigate to the server’s address (most likely https://localhost:8888
), you will probably get a warning about the connection being insecure.
This is normal and correct, since the certificate generated by simplehttp2server is self-signed and doesn’t carry the signature of any common certificate authority (CA). All browsers offer a way to temporarily ignore this error and proceed. This is safe to do.
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 on https://localhost with a self-signed certificate you haven't explicitly "trusted".
Any Link
headers with rel=preload
will be translated to a HTTP/2 PUSH, as is common practice on static hosting platforms and CDNs. See the example above.