mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #5034 from ZhuPeng/proxy-http2
Enable http2 support between proxy and member
This commit is contained in:
commit
f15b5aa4e6
@ -19,6 +19,8 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/http2"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -42,6 +44,14 @@ type GetProxyURLs func() []string
|
||||
// which will proxy requests to an etcd cluster.
|
||||
// The handler will periodically update its view of the cluster.
|
||||
func NewHandler(t *http.Transport, urlsFunc GetProxyURLs, failureWait time.Duration, refreshInterval time.Duration) http.Handler {
|
||||
if t.TLSClientConfig != nil {
|
||||
// Enable http2, see Issue 5033.
|
||||
err := http2.ConfigureTransport(t)
|
||||
if err != nil {
|
||||
plog.Infof("Error enabling Transport HTTP/2 support: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
p := &reverseProxy{
|
||||
director: newDirector(urlsFunc, failureWait, refreshInterval),
|
||||
transport: t,
|
||||
|
Loading…
x
Reference in New Issue
Block a user