瀏覽代碼

Merge pull request #6463 from xiang90/fix_http

embed: fix go 1.7 http issue
Xiang Li 9 年之前
父節點
當前提交
33dbf5c6bd
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      pkg/transport/listener.go

+ 3 - 0
pkg/transport/listener.go

@@ -208,6 +208,9 @@ func (info TLSInfo) ServerConfig() (*tls.Config, error) {
 		cfg.ClientCAs = cp
 	}
 
+	// "h2" NextProtos is necessary for enabling HTTP2 for go's HTTP server
+	cfg.NextProtos = []string{"h2"}
+
 	return cfg, nil
 }