update quic-go to v0.13.0 (#2862)

This version supports IETF QUIC draft-23.
This commit is contained in:
Marten Seemann
2019-11-06 14:30:29 +07:00
committed by Matt Holt
parent 3f9a431100
commit aa94f2b802
8 changed files with 44 additions and 17 deletions

View File

@@ -35,13 +35,13 @@ import (
"github.com/caddyserver/caddy/caddyhttp/staticfiles"
"github.com/caddyserver/caddy/caddytls"
"github.com/caddyserver/caddy/telemetry"
"github.com/lucas-clemente/quic-go/h2quic"
"github.com/lucas-clemente/quic-go/http3"
)
// Server is the HTTP server implementation.
type Server struct {
Server *http.Server
quicServer *h2quic.Server
quicServer *http3.Server
sites []*SiteConfig
connTimeout time.Duration // max time to wait for a connection before force stop
tlsGovChan chan struct{} // close to stop the TLS maintenance goroutine
@@ -104,7 +104,7 @@ func NewServer(addr string, group []*SiteConfig) (*Server, error) {
if s.Server.TLSConfig != nil {
// enable QUIC if desired (requires HTTP/2)
if HTTP2 && QUIC {
s.quicServer = &h2quic.Server{Server: s.Server}
s.quicServer = &http3.Server{Server: s.Server}
s.Server.Handler = s.wrapWithSvcHeaders(s.Server.Handler)
}