gohttp icon indicating copy to clipboard operation
gohttp copied to clipboard

Support HTTP2

Open item4 opened this issue 9 years ago • 2 comments

go 1.6 support HTTP2.

Can you make it working with HTTP2?

item4 avatar Feb 20 '16 05:02 item4

@item4 I'm sorry, I don't know much about HTTP2, but pay attention to that

"Go1.6addstransparentsupportinthenet/httppackageforthenewHTTP/2protocol. Go clients and servers will automatically use HTTP/2 as appropriate when using HTTPS"

Need a further confirmation that Go 1.6 net/http just only support HTTP2 when using HTTPS?

itang avatar Feb 22 '16 13:02 itang

I don't know much about HTTP2 too and I don't know about golang too :( But, I love this program for testing static web, so I searched some informations.

From this article, we can know we can apply HTTP2 simply with http2.ConfigureServer(srv, &http2.Server{}).

I think(just think) we can use it at this line with some modification.

srv = &http.Server{
    Addr: addr,
}
http2.ConfigureServer(srv, &http2.Server{})
// make self-signed cert (how?)
log.Fatal(srv.ListenAndServeTLS("server.crt", "server.key"))

item4 avatar Feb 22 '16 16:02 item4