From 7888d3e13d534f918ed42ede872907f429bc8858 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Thu, 31 Jan 2019 17:14:36 +0000 Subject: [PATCH] use official h2c server --- transport/http_transport.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/transport/http_transport.go b/transport/http_transport.go index 2b3619ed..ea98accc 100644 --- a/transport/http_transport.go +++ b/transport/http_transport.go @@ -13,11 +13,11 @@ import ( "sync" "time" - "github.com/micro/h2c" maddr "github.com/micro/util/go/lib/addr" mnet "github.com/micro/util/go/lib/net" mls "github.com/micro/util/go/lib/tls" "golang.org/x/net/http2" + "golang.org/x/net/http2/h2c" ) type buffer struct { @@ -424,10 +424,7 @@ func (h *httpTransportListener) Accept(fn func(Socket)) error { // insecure connection use h2c if !(h.ht.opts.Secure || h.ht.opts.TLSConfig != nil) { - srv.Handler = &h2c.HandlerH2C{ - Handler: mux, - H2Server: &http2.Server{}, - } + srv.Handler = h2c.NewHandler(mux, &http2.Server{}) } // begin serving