mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-29 18:33:05 +00:00
Try to support plaintext http2 after termination
This commit is contained in:
parent
8853ccd5b4
commit
2aba37d2ef
1 changed files with 6 additions and 1 deletions
7
app.go
7
app.go
|
@ -31,10 +31,13 @@ import (
|
|||
ginprometheus "github.com/zsais/go-gin-prometheus"
|
||||
"golang.org/x/crypto/acme"
|
||||
"golang.org/x/crypto/acme/autocert"
|
||||
"golang.org/x/net/http2"
|
||||
"golang.org/x/net/http2/h2c"
|
||||
"golang.org/x/oauth2"
|
||||
"golang.org/x/sync/errgroup"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
|
||||
// "google.golang.org/grpc/credentials"
|
||||
"google.golang.org/grpc/metadata"
|
||||
"google.golang.org/grpc/peer"
|
||||
|
@ -577,9 +580,11 @@ func (h *Headscale) Serve() error {
|
|||
|
||||
router := h.createRouter(grpcGatewayMux)
|
||||
|
||||
h2s := &http2.Server{}
|
||||
|
||||
httpServer := &http.Server{
|
||||
Addr: h.cfg.Addr,
|
||||
Handler: router,
|
||||
Handler: h2c.NewHandler(router, h2s),
|
||||
ReadTimeout: HTTPReadTimeout,
|
||||
// Go does not handle timeouts in HTTP very well, and there is
|
||||
// no good way to handle streaming timeouts, therefore we need to
|
||||
|
|
Loading…
Reference in a new issue