Commit da5b3cfc authored by Matt Holt's avatar Matt Holt Committed by GitHub

Merge pull request #976 from wjkohnen/h2

Re-enable HTTP/2 for Go 1.7.
parents 372c77da d88dd74d
...@@ -92,6 +92,10 @@ func NewServer(addr string, group []*SiteConfig) (*Server, error) { ...@@ -92,6 +92,10 @@ func NewServer(addr string, group []*SiteConfig) (*Server, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
// Since Go 1.7 HTTP/2 is enabled only if TLSConfig.NextProtos includes the string "h2".
if HTTP2 && s.Server.TLSConfig != nil && len(s.Server.TLSConfig.NextProtos) == 0 {
s.Server.TLSConfig.NextProtos = []string{"h2"}
}
// Compile custom middleware for every site (enables virtual hosting) // Compile custom middleware for every site (enables virtual hosting)
for _, site := range group { for _, site := range group {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment