peerapi_h2c.go 340 B

1234567891011121314151617181920
  1. // Copyright (c) Tailscale Inc & AUTHORS
  2. // SPDX-License-Identifier: BSD-3-Clause
  3. //go:build !ios && !android && !js
  4. package ipnlocal
  5. import (
  6. "net/http"
  7. "golang.org/x/net/http2"
  8. "golang.org/x/net/http2/h2c"
  9. )
  10. func init() {
  11. addH2C = func(s *http.Server) {
  12. h2s := &http2.Server{}
  13. s.Handler = h2c.NewHandler(s.Handler, h2s)
  14. }
  15. }